As it stands, I need to crop a portion of an image and then on that cropped image crop it again. This in order to generate 2 thumbnails of a different size for file storage.
The problem is when I use the cropImage function on the imagemagick object the first time, it works like a charm. The second time however, I get 1x1 pixel results.
Short example
Code: Select all
$imagick = new Imagick($src_url);
// Do stuff to calculate x and y
$imagick->cropImage($largeThumbWidth,$largeThumbHeight,$x,$y);
$imagick->writeImage($dst_url .'largethumb'. $dst_filename . '.jpg');
// Now make the small thumb, I fixed the values to be sure
$imagick->cropImage(75,75,0,0);
$imagickthumb->writeImage($dst_url .'smallthumb'. $dst_filename . '.jpg');
I do not want the coordinates to be 0,0 as some randomness is nice for the image gallery this is reaquired.
Does anyone see where I went wrong?
Thanks!
Ayame