Resize if over certain size
<?php
exec("convert input.jpg -resize '250x90>' output.jpg");
?>Only resize the image if it is over the set sizes. Note the images are read into the memory to check the size then saved anyway this will cause some compression on jpg images. Check the file size externaly to prevent this.
More information about this snippet