Crop settings

See all posts Reply

Crop settings new!
by Ogum, 11 years ago
Hello,

I'm trying to set the configuration of the class to have, after uploading, always an image of 1500 x 550px, but I can not ..
Obviously, the original image must be larger
Could someone help me? thanks

The setting that is almost correct
$handle->image_resize            = true;
$handle->image_ratio_y           = true;
$handle->image_x                 = 1500;
$handle->image_crop              = '25.6% 0%';
Reply
Re: Crop settings new!
by colin, 11 years ago
Do not use image_ratio_crop for that purpose.

In order to fill in precise dimensions, you need to use _image_ratio_crop_ (or _image_ratio_fill):
$handle->image_resize     = true;
$handle->image_ratio_crop = true;
$handle->image_x          = 1500;
$handle->image_y          = 550;

image_ratio_crop will resize the image so that your surface is covered, cutting out extra parts of the image. image_ratio_fill will resize the image so that it fits all in your surface, and will fill in the rest with a color (or transparency).Reply