Removed the legacy workaround for ancient ImageMagick versions
authorAlexander Ebert <ebert@woltlab.com>
Mon, 14 Dec 2020 12:43:18 +0000 (13:43 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 14 Dec 2020 12:43:18 +0000 (13:43 +0100)
wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php

index e690e2a618c104da0cbf00c96c05b4655b475cc6..eb1912e9ec540fc7bbb9aaa9477d75c4550f8bf0 100644 (file)
@@ -349,25 +349,17 @@ class ImagickImageAdapter implements IImageAdapter {
                        throw new SystemException("Given image is not a valid Imagick-object.");
                }
                
-               // circumvent writeImages() bug in version 3.1.0 RC 1
-               if (phpversion('imagick') == '3.1.0RC1' && $this->supportsWritingAnimatedGIF) {
-                       $file = fopen($filename, 'w');
-                       $image->writeImagesFile($file);
-                       fclose($file);
-               }
-               else {
-                       // Greatly reduces the time required to create the image and drastically
-                       // reduces the filesize to more reasonable levels without a visible
-                       // quality loss.
-                       //
-                       // See https://github.com/Imagick/imagick/issues/360
-                       if ($image->getImageFormat() == 'GIF') {
-                               $image = $image->deconstructImages();
-                               $image->quantizeImages(256, \Imagick::COLORSPACE_SRGB, 0, false, false);
-                       }
-                       
-                       $image->writeImages($filename, true);
+               // Greatly reduces the time required to create the image and drastically
+               // reduces the filesize to more reasonable levels without a visible
+               // quality loss.
+               //
+               // See https://github.com/Imagick/imagick/issues/360
+               if ($image->getImageFormat() == 'GIF') {
+                       $image = $image->deconstructImages();
+                       $image->quantizeImages(256, \Imagick::COLORSPACE_SRGB, 0, false, false);
                }
+               
+               $image->writeImages($filename, true);
        }
        
        /**