From 0e7651081c8d5fea46dbd3f1a253b0f211cd5522 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 14 Dec 2020 13:43:18 +0100 Subject: [PATCH] Removed the legacy workaround for ancient ImageMagick versions --- .../adapter/ImagickImageAdapter.class.php | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php index e690e2a618..eb1912e9ec 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php @@ -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); } /** -- 2.20.1