Re: about image resizing with crop and no enlarging

See all posts Reply

Re: about image resizing with crop and no enlarging new!
by Edgars, 3 years, 9 months ago
Hi, i dont know if it is inttentional behaviour but it doesnt look like it for me. Problem is when im using $handle->image_resize = true; with $handle->image_ratio_crop = true; and $handle->image_no_enlarging = true;
I set $handle->image_x = 1000; and $handle->image_y = 1000;
So when i process images if both original image sides are greater than they are set for then output image is as expected but if one of the sides is smaller then there is really strange behaviour. i thought that if i set $handle->image_no_enlarging = true; then in those cases image will not be resized, but it resizes and resizes very odd, for example if input image is 1096x480 px then output image is 1x480 px and if input image is 800x533 px then output image is 300x533 pxReply
Re: about image resizing with crop and no enlarging new!
by colin, 3 years, 9 months ago
You're right, there was a bug. I have fixed it, you can try the master branch on Github. Thanks!Reply
Re: about image resizing with crop and no enlarging new!
by Edgars, 3 years, 9 months ago
Thank you! I thought it would be really nice if class had another option(something like preserve target ratio, fallback option) when there is crop together with no enlarge(maybe another option to thees two) - its like this - if for example y side of input image are smaller than target y size then we set new_target_Y as input images y and calculate new_target_X by actual_Y/old_target_Y*old_target_X so then we have resized image based on proportions of target dimensions and crop even if it didnt fit.
Thank you for your great class!Reply