what if original photo is smaller than image_x or image_y?

See all posts Reply

what if original photo is smaller than image_x or image_y? new!
by Tomy, 14 years, 5 months ago
Hello,

Great class for photo upload and manipulations. But I have question about the issue i faced with.

I have uploaded a photo (100px x 100px) and I want to resize it to 900 (image_x = 900)

The class enlarges the original uploaded photo but I don't want to resize it if it is smaller than the ratio.

How can I implement it?Reply
Re: what if original photo is smaller than image_x or image_y? new!
by colin, 14 years, 5 months ago
Use image_ratio_no_zoom_in instead of image_ratio_xxxxxReply
Re: what if original photo is smaller than image_x or image_y? new!
by Tomy, 14 years, 5 months ago
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!
by colin, 14 years, 5 months ago
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_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.Reply