Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
When cropping with PHP Imagick, some gifs that are cropped correctly with ImageMagick 6.7.7-10 have errors after cropping on server with 6.9.1-7 version installed. What could be the problem?
Here is the PHP code responsible for cropping:
--------------------------------------------------------------------
$image = new \Imagick($file->tempName);
if($file->type=="image/gif") //determine image format
{
//if it's GIF file, resize each frame
$image = $image->coalesceImages();
if ($play_once) {
$image->setimageiterations(1);
}
$i = 0;
foreach ($image as $frame) {
$frame->cropImage($image_width,$image_height,$x,$y);
$frame->setimagepage(0, 0, 0, 0);
if ($i==0) {
$preview_path = str_replace('.gif', '.png', $upload_path);
$frame->writeimage($preview_path);
}
$i++;
}
$image = $image->deconstructImages();
}
//write image to a file
return $image->writeImages($upload_path, true);
------------------------------------------------------------------------------------------------------------------------------------------------------------