Donations accepted

Hosted on verot.net

Resizing based on smaller side.

See all posts Reply

Resizing based on smaller side. new!
by Ferdia, 2 years, 2 months ago
In your demos you have a great example:
$foo->image_resize          = true;
$foo->image_ratio           = true;
$foo->image_y               = 50;
$foo->image_x               = 50;

This seems to result in the larger side being reduced to 50, and the smaller side being ratio'd. My question is, is there any way for the smaller side to be the base. So in your example, you end up with 50x33, but in the same image, I'd be looking for it to end up as 75x50, if you get what I'm saying.

FerdiaReply
Re: Resizing based on smaller side. new!
by colin, 2 years, 2 months ago
You can find out the smallest side like this:
if ($handle->image_src_x < $handle->image_src_y) {
    $handle->image_x = 50;
    $handle->image_ratio_y = true;
} else {
    $handle->image_y = 50;
    $handle->image_ratio_x = true;
}  
$handle->process(...);
Reply
Re: Resizing based on smaller side. new!
by Ferdia, 2 years, 2 months ago
A gentleman and a scholar!

Thank's very much.Reply