From fe04f4a20a7c5fd71e1db1540172e4b13f3719c4 Mon Sep 17 00:00:00 2001 From: Hans Nieser Date: Wed, 16 Aug 2017 11:12:27 +0200 Subject: [PATCH] Fix fatal error due to missing interpolation method Even with a high enough version of Imagick, this interpolation method seems to not always be available, so fall back to default method --- .../code/community/Varien/Image/Adapter/Imagemagic.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/code/community/Varien/Image/Adapter/Imagemagic.php b/src/app/code/community/Varien/Image/Adapter/Imagemagic.php index d510011..971b8c9 100644 --- a/src/app/code/community/Varien/Image/Adapter/Imagemagic.php +++ b/src/app/code/community/Varien/Image/Adapter/Imagemagic.php @@ -135,8 +135,12 @@ public function resize($frameWidth = null, $frameHeight = null) } } - // Resize - $imagick->setimageinterpolatemethod(imagick::INTERPOLATE_BICUBIC); + // Resize image. Bicubic interpolation does not always seem available, even with a high enough version of + // ImageMagick. However the default interpolation method also seems to produce decent results. + if (defined('Imagick::INTERPOLATE_BICUBIC')) { + $imagick->setimageinterpolatemethod(Imagick::INTERPOLATE_BICUBIC); + } + $imagick->scaleimage($frameWidth, $frameHeight, true); // Fill desired canvas