Climb an image with imagick without deforming the original

1

I have an application where the user can upload an image, crop and "work" the image, adding props etc ... My problem is in the crop because the max size of the crop is always different depending on the the resolution of the images, to combat this I thought to put all the images with the same resolution that also works but I need to specify the width and height of the image, some way to only define one of them (other solutions are welcome ) so as to never deform the image that was 'uploaded' by the user? I have this code, it works fine:

$thumb = new Imagick();
$thumb->readImage('imgTest.jpg');
$thumb->resizeImage(300,3000,Imagick::FILTER_LANCZOS,1);
$thumb->writeImage('imgTest.jpg');
$thumb->clear();
$thumb->destroy(); 
    
asked by anonymous 13.12.2014 / 12:48

0 answers