From: Alexander Ebert Date: Mon, 14 Dec 2020 12:43:18 +0000 (+0100) Subject: Removed the legacy workaround for ancient ImageMagick versions X-Git-Tag: 5.3.2~42^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e7651081c8d5fea46dbd3f1a253b0f211cd5522;p=GitHub%2FWoltLab%2FWCF.git Removed the legacy workaround for ancient ImageMagick versions --- 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); } /**