Reduce image size on upload.
Reduce image size on upload.
I have the following simple PHP resizer working okay.
```
<?php
ini_set('memory_limit', '2G');
include 'ImageResize.php';
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$image = new \Eventviva\ImageResize('image.jpg');
$image->scale(10);
$image->save('image3.jpg')
On the file upload I want to:
- check file size ( > 1 meg reduce )
- Keep the original as 26Large.jpg
- Return the 26.jpg file into the editor.
Anyone done this already ?
Or where in the chain of event do I start ?
Cheers
Steve Warby
This discussion has been closed.
Answers
You would use a custom upload action for this. There are a few threads on this topic already if you search for "Editor upload thumbnail" - for example.
Allan
Thanks Allan,
I have a play tonight.
Cheers
Steve Warby