From c2855ed91c5ec6b3ac566810d2674dcbfa02e7b9 Mon Sep 17 00:00:00 2001 From: Vlad Podorozhnyi Date: Thu, 21 Dec 2023 14:00:56 +0100 Subject: [PATCH] Fix integration tests error: Magento\Framework\Image\Adapter\InterfaceTest::testRotate with data set #4 ('/var/www/html/dev/tests/integ...st.png', 45, array(157, 35), 'IMAGEMAGICK') ImagickException: unrecognized color `srgb255,255,255' @ warning/color.c/GetColorCompliance/1064 --- lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php b/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php index 4f10f5cad92..309075d1df5 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php +++ b/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php @@ -268,8 +268,8 @@ public function rotate($angle) $angle = 360 - $angle; $pixel = new \ImagickPixel(); - if (preg_match('/^s?rgb\((\d+),(\d+),(\d+)\)$/', $this->imageBackgroundColor, $matches)) { - $pixel->setColor('rgb(' . $matches[1] . ',' . $matches[2] . ',' . $matches[3] . ')'); + if (preg_match('/^(s?rgb)\((\d+),(\d+),(\d+)\)$/', $this->imageBackgroundColor, $matches)) { + $pixel->setColor(sprintf("%s(%s,%s,%s)", $matches[1], $matches[2], $matches[3], $matches[4])); } else { $pixel->setColor("rgb(" . $this->imageBackgroundColor . ")"); }