Cropping question

See all posts See thread Reply

Re: Cropping question new!
by colin, 17 years, 3 months ago
No, it is not possible to keep the entire image if you want to fill in a precise dimension, and keep the ratio. One elegant way to do that is to use image_ratio_crop, but if you want to keep the image, and fill the rest with a color, you will need something like image_ratio_fill, and a way to set the background color.

It is a good idea, I will probably implement it in the next release.

However, I am not sure it is very wise, since you can just display your pics in a DIV on your page. the DIV can have a fixed dimension, and you center the picture in the DIV.
But the feature might be useful in some cases, so I'll add it in.Reply
Re: Cropping question new!
by Anubis, 17 years, 3 months ago
Thanks.

You probably know it already, but the functions 'imagecopyresampled' and 'imagefill' may help you making the option.

In fact, it is the same option as adjusting the canvas size in Photoshop. Maybe it is nice to also let the user choose which way the canvas has to expand... from center out or only to the left or right.

There are plenty of examples where all images has to be an exact size. In a recent thread, about 60 x 60.... I think it is the same question as mine.

But, thanks for everything!Reply
Re: Cropping question new!
by colin, 17 years, 3 months ago
I will probably add it in a future release. It is quite easy to implement.

My point was about the usefulness of doing it, but since it is being asked and seems needed, I will implement it.Reply