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.
I want to limit the max image width to 400, therefore, If I upload a image 1000 x 1000, it should be 400 x 400, if I upload 300 x 300, it should remained 300 x 300, but image always re size to 400 x xxx, here is my setting, how to implement that?
You cannot use two image_ratio_xxxx properties at the same time. In fact, you cannot have a "no_zoom_out" effect if you are using image_ratio_y, it is a known shortcoming.Reply
$foo->file_new_name_body = $newName; $foo->image_convert = 'jpg'; $foo->jpeg_quality = 100; if ($foo->image_src_x > $maxWidth) { $foo->image_x = $maxWidth; $foo->image_resize = true; $foo->image_ratio_y = true; }