@@ -29,7 +29,12 @@ public function decode(mixed $input): ImageInterface|ColorInterface
             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
         switch ($imagick->getImageOrientation()) {