Reduce image size on upload.

Reduce image size on upload.

classic12classic12 Posts: 228Questions: 60Answers: 4

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')

<?php > ``` ?>

On the file upload I want to:

  1. check file size ( > 1 meg reduce )
  2. Keep the original as 26Large.jpg
  3. 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

Answers

This discussion has been closed.