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::testCreatePngFromString with data set #1 (array(5, 12), array(0, 0, 0), array(0, 20), array(255, 255, 255), 'IMAGEMAGICK')
PHPUnit\Framework\Exception: Deprecated: Implicit conversion from float 11.34375 to int loses precision in /var/www/html/lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php:505.
  • Loading branch information
vpodorozh committed Dec 8, 2023
1 parent c9da6b7 commit a84d79c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public function createPngFromString($text, $font = '')
$draw->annotation(0, $metrics['ascender'], $text);

$height = abs($metrics['ascender']) + abs($metrics['descender']);
$image->newImage($metrics['textWidth'], (int) $height, $background);
$image->newImage((int) $metrics['textWidth'], (int) $height, $background);
$this->_fileType = IMAGETYPE_PNG;
$image->setImageFormat('png');
$image->drawImage($draw);
Expand Down

0 comments on commit a84d79c

Please sign in to comment.