From 5f5c92364ff4f85e2bb87dd1d2593b9ed741fec0 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Fri, 10 Nov 2023 00:23:56 +0100 Subject: [PATCH] [php-8.1] Fixes deprecated passing null --- lib/Varien/Image/Adapter/Gd2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Varien/Image/Adapter/Gd2.php b/lib/Varien/Image/Adapter/Gd2.php index 92219bcd927..8f99a6c9cab 100644 --- a/lib/Varien/Image/Adapter/Gd2.php +++ b/lib/Varien/Image/Adapter/Gd2.php @@ -263,7 +263,7 @@ private function _fillBackgroundColor(&$imageResourceTo) $transparentColor = false; if ($transparentIndex >= 0 && $transparentIndex < imagecolorstotal($this->_imageHandler)) { list($r, $g, $b) = array_values(imagecolorsforindex($this->_imageHandler, $transparentIndex)); - $transparentColor = imagecolorallocate($imageResourceTo, $r, $g, $b); + $transparentColor = imagecolorallocate($imageResourceTo, (int)$r, (int)$g, (int)$b); } if (false === $transparentColor) { throw new Exception('Failed to allocate transparent color for image.'); @@ -279,7 +279,7 @@ private function _fillBackgroundColor(&$imageResourceTo) } } list($r, $g, $b) = $this->_backgroundColor; - $color = imagecolorallocate($imageResourceTo, $r, $g, $b); + $color = imagecolorallocate($imageResourceTo, (int)$r, (int)$g, (int)$b); if (!imagefill($imageResourceTo, 0, 0, $color)) { throw new Exception("Failed to fill image background with color {$r} {$g} {$b}. File: {$this->_fileName}"); }