Reply to Re: What happens with portrait images?

Re: What happens with portrait images? new!
by colin, 15 years, 11 months ago
You can set image_x and image_y at the same time, using image_ratio. The image will then be resized to fit within the two dimensions, maintaining aspect ratio and orientation.

For instance:
$foo->image_ratio = true;
$foo->image_x = 400;
$foo->image_y = 400;
will resize your images so that they fit within 400x400:
1024x768 resized to  400x300
768x1024 resized to  300x400

See this thread or this other one which describes a more advanced method.

Note that you can also use image_ratio_crop instead of image_ratio. That would then make the image to be exactly 400x400, maintaining aspect ratio, and discarding excess image. Try it to see what it does. You can also try image_ratio_fill, which is more similar to image_ratio.Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important