1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-29 16:50:07 +02:00

Merge pull request #1262 from Intervention/bugfix/coalesce-images-decoding-error

Fix decoding error with Imagick driver
This commit is contained in:
Oliver Vogel
2024-01-14 08:47:00 +01:00
committed by GitHub

View File

@@ -29,7 +29,12 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
throw new DecoderException('Unable to decode input'); throw new DecoderException('Unable to decode input');
} }
$imagick = $imagick->coalesceImages(); // For some JPEG formats, the "coalesceImages()" call leads to an image
// completely filled with background color. The logic behind this is
// incomprehensible for me; could be an imagick bug.
if ($imagick->getImageFormat() != 'JPEG') {
$imagick = $imagick->coalesceImages();
}
// fix image orientation // fix image orientation
switch ($imagick->getImageOrientation()) { switch ($imagick->getImageOrientation()) {