Skip to content

Commit 1f08dfe

Browse files
author
Alexander Tolochko
committed
Fix error 'imagecolorsforindex(): Argument #2 ($color) is out of range'
1 parent 509545b commit 1f08dfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Model/Image/Adapter/Gd2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ private function applyTransparency(&$imageResourceTo, $transparentIndex): void
391391
// fill image with indexed non-alpha transparency
392392
$transparentColor = false;
393393

394-
if ($transparentIndex >= 0 && $transparentIndex <= imagecolorstotal($this->_imageHandler)) {
394+
if ($transparentIndex >= 0 && $transparentIndex < imagecolorstotal($this->_imageHandler)) {
395395
list($red, $green, $blue) = array_values(imagecolorsforindex($this->_imageHandler, $transparentIndex));
396396
$transparentColor = imagecolorallocate($imageResourceTo, (int) $red, (int) $green, (int) $blue);
397397
}

0 commit comments

Comments
 (0)