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.
When i use $handle->image_x = 900; and image_ratio_no_zoom_in instead of image_ratio_y on a 1280x800 source, the photo becomes 240x150.
What i need is to make it smaller when the source photo larger than 900 width else take original without zooming in or without try to maximize 100x100 source to 900px widthReply
Re: what if original photo is smaller than image_x or image_y? new!
The setting image_ratio_no_zoom_in replaces image_ratio, not image_ratio_y.
If you use image_ratio_no_zoom_in or image_ratio, you need to set image_ratio_xandimage_ratio_y. If you don't set image_ratio_y, it defaults to 150.
There is currently no way to have the "no_zoom_in" option to automatically check only on the width. That said, you can program it yourself: before calling process, read image_src_x and image_src_y and depending on the values, adapt the ratio settings for both your cases.Reply
What i need is to make it smaller when the source photo larger than 900 width
else
take original without zooming in or without try to maximize 100x100 source to 900px width
If you use image_ratio_no_zoom_in or image_ratio, you need to set image_ratio_x and image_ratio_y. If you don't set image_ratio_y, it defaults to 150.
There is currently no way to have the "no_zoom_in" option to automatically check only on the width. That said, you can program it yourself: before calling process, read image_src_x and image_src_y and depending on the values, adapt the ratio settings for both your cases.