fixed some GIF thumbnails resulting in "corrupt" images.
in order to do this, Imagick::coalesceImages() is called if the image to process is gif and has frames. this method slows down things, but ensures a good thumbnail.
This commit is contained in:
parent
272fc76629
commit
be797d2a17
@ -22,6 +22,9 @@ abstract class Resizer
|
|||||||
|
|
||||||
if (class_exists('Imagick', false)) {
|
if (class_exists('Imagick', false)) {
|
||||||
$image = new Imagick($read_path);
|
$image = new Imagick($read_path);
|
||||||
|
if ($file_ext == 'gif' && $image->getNumberImages()) {
|
||||||
|
$image = $image->coalesceImages()->current();
|
||||||
|
}
|
||||||
$image->cropImage($crop_width, $crop_height, $crop_left, $crop_top);
|
$image->cropImage($crop_width, $crop_height, $crop_left, $crop_top);
|
||||||
$image->thumbnailImage($width, $height);
|
$image->thumbnailImage($width, $height);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user