Skip to content

Commit

Permalink
Fix integration tests error:
Browse files Browse the repository at this point in the history
Magento\Framework\Image\Adapter\InterfaceTest::testRotate with data set mage-os#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
  • Loading branch information
vpodorozh committed Dec 21, 2023
1 parent 6088684 commit c2855ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ")");
}
Expand Down

0 comments on commit c2855ed

Please sign in to comment.