Fixed generating thumbnails of GIF images

This commit is contained in:
Marcin Kurczewski 2014-11-10 20:44:32 +01:00
parent a2ff2d25ae
commit cc6b7e41bc

View file

@ -44,8 +44,11 @@ class ImagickImageManipulator implements IImageManipulator
switch ($format) switch ($format)
{ {
case self::FORMAT_JPEG: case self::FORMAT_JPEG:
$imageResource->setImageBackgroundColor('white'); $matte = new \Imagick();
$imageResource = $imageResource->flattenImages(); $matte->newImage($imageResource->getImageWidth(), $imageResource->getImageHeight(), 'white');
$matte->compositeimage($imageResource, \Imagick::COMPOSITE_OVER, 0, 0);
$imageResource->destroy();
$imageResource = $matte;
$imageResource->setImageFormat('jpeg'); $imageResource->setImageFormat('jpeg');
break; break;