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.
Either you use image_ratio_no_zoom_in, same as image_ratio, but won't resize if the source image is smaller than image_x x image_y (default: false)
$handle->image_ratio_no_zoom_in = true;
Or else, if you don't want to explicitely set image_y, you can read some variables before calling Process(), such as image_src_x, image_src_y and image_src_type and depending on the values, you do a resizing or not.Reply
Or else, if you don't want to explicitely set image_y, you can read some variables before calling Process(), such as image_src_x, image_src_y and image_src_type and depending on the values, you do a resizing or not.