A
A
Anton2016-04-22 06:45:48
Kohana
Anton, 2016-04-22 06:45:48

Reducing a photo to the desired size, how to set up a photo processor?

Hello, I have a question about resizing a photo.
Site on Kohan framework. 3.1 kohan version.
When uploading a photo, I made it crop the photo 1000x600, it does not always crop well.
How to implement photo resizing, up to 1000x600
I tried $im->resize(1000, 600);
I tried to upload a photo, it was 1200x900, the handler cut it so 900x600.
Although the parameters are to reduce not less than 1000 in length, and not less than 600 in width, and he reduced in width to 600, and in length to 1000, it's not quite right, how can I fix this? so that the handler reduces it to 1000x600, and not less than one of the sides, if it is too much, then it is acceptable to cut it off.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-04-22
Websaytovsky @ws17

Found the solution:
Recompressing the image to the exact size of 32x32
$image->resize(32, 32, Image::NONE);
Recompressing the image according to the aspect ratio up to 100x100:
$image->resize(100, 100, Image::AUTO);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question