Skip to content

Commit

Permalink
PHP 8 Fatal error: Uncaught ValueError: imagecolorsforindex() in Vari…
Browse files Browse the repository at this point in the history
…en_Image_Adapter_Gd2 (#2197)
  • Loading branch information
iamniels authored Jun 6, 2022
1 parent 02bd670 commit 45db076
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Varien/Image/Adapter/Gd2.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private function _fillBackgroundColor(&$imageResourceTo)
// fill image with indexed non-alpha transparency
elseif (false !== $transparentIndex) {
$transparentColor = false;
if ($transparentIndex >=0 && $transparentIndex <= imagecolorstotal($this->_imageHandler)) {
if ($transparentIndex >=0 && $transparentIndex < imagecolorstotal($this->_imageHandler)) {
list($r, $g, $b) = array_values(imagecolorsforindex($this->_imageHandler, $transparentIndex));
$transparentColor = imagecolorallocate($imageResourceTo, $r, $g, $b);
}
Expand Down

0 comments on commit 45db076

Please sign in to comment.