From 274427dc2e36449db88ce5736ecd2a7d67ec5364 Mon Sep 17 00:00:00 2001 From: i42 Date: Fri, 9 Dec 2016 15:21:22 +0200 Subject: [PATCH 1/2] Fix resize bug Resize not works when resize width/height equal to image width/height --- src/app/code/community/Varien/Image/Adapter/Imagemagic.php | 3 +-- 1 file changed, 1 insertion(+), 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 a5c6ce2..e3e5bb3 100644 --- a/src/app/code/community/Varien/Image/Adapter/Imagemagic.php +++ b/src/app/code/community/Varien/Image/Adapter/Imagemagic.php @@ -141,8 +141,7 @@ public function resize($frameWidth = null, $frameHeight = null) // Fill desired canvas if ($this->keepFrame() === TRUE - && $frameWidth != $origWidth - && $frameHeight != $origHeight + && ($frameWidth != $origWidth || $frameHeight != $origHeight) ) { $composite = new Imagick(); $color = $this->_backgroundColor; From aae72077ba34829a48c4f9e633c3e36c53326be6 Mon Sep 17 00:00:00 2001 From: i42 Date: Sun, 5 Nov 2017 13:28:48 +0200 Subject: [PATCH 2/2] Check if INTERPOLATE_BICUBIC constant exists --- src/app/code/community/Varien/Image/Adapter/Imagemagic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/code/community/Varien/Image/Adapter/Imagemagic.php b/src/app/code/community/Varien/Image/Adapter/Imagemagic.php index e3e5bb3..074e670 100644 --- a/src/app/code/community/Varien/Image/Adapter/Imagemagic.php +++ b/src/app/code/community/Varien/Image/Adapter/Imagemagic.php @@ -136,7 +136,9 @@ public function resize($frameWidth = null, $frameHeight = null) } // Resize - $imagick->setimageinterpolatemethod(imagick::INTERPOLATE_BICUBIC); + if (defined('imagick::INTERPOLATE_BICUBIC')) { + $imagick->setimageinterpolatemethod(imagick::INTERPOLATE_BICUBIC); + } $imagick->scaleimage($frameWidth, $frameHeight, true); // Fill desired canvas