class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
2. Otherwise, you can set un maximum number of pixels, using image_ratio_pixels. So the image will be resized to approximate this maximum number of pixels.
First, you should not have more than one image_ratio_xxxx used together. So your code:
should be:
To do what you describe, you have two possibilities:
1. Resize only if the picture is larger than the specified sizes, using image_ratio_no_zoom_in
2. Otherwise, you can set un maximum number of pixels, using image_ratio_pixels. So the image will be resized to approximate this maximum number of pixels.