1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-08 06:46:33 +02:00

Fix decoding error with Imagick driver

See: https://github.com/Intervention/image/issues/1261
This commit is contained in:
Oliver Vogel
2024-01-10 15:08:16 +01:00
parent f8c6f315a2
commit 1e4afd57cf

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; could be an imagemagick bug.
if ($imagick->getImageFormat() != 'JPEG') {
$imagick = $imagick->coalesceImages();
}
// fix image orientation // fix image orientation
switch ($imagick->getImageOrientation()) { switch ($imagick->getImageOrientation()) {