Skip to content

Commit ecf36e9

Browse files
committed
ACP2E-1632: GIF Images issue on product page
1 parent 5abd517 commit ecf36e9

File tree

1 file changed

+2
-2
lines changed
  • lib/internal/Magento/Framework/Image/Adapter

1 file changed

+2
-2
lines changed

lib/internal/Magento/Framework/Image/Adapter/Gd2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ private function applyTransparency(&$imageResourceTo, $transparentIndex): void
343343
// fill image with indexed non-alpha transparency
344344
$transparentColor = false;
345345

346-
if ($transparentIndex >= 0 && $transparentIndex <= imagecolorstotal($this->_imageHandler)) {
346+
if ($transparentIndex >= 0 && $transparentIndex < imagecolorstotal($this->_imageHandler)) {
347347
try {
348348
$colorsForIndex = imagecolorsforindex($this->_imageHandler, $transparentIndex);
349349
list($red, $green, $blue) = array_values($colorsForIndex);
@@ -391,7 +391,7 @@ private function _getTransparency($imageResource, $fileType, &$isAlpha = false,
391391
if (IMAGETYPE_GIF === $fileType || IMAGETYPE_PNG === $fileType) {
392392
// check for specific transparent color
393393
$transparentIndex = imagecolortransparent($imageResource);
394-
if ($transparentIndex >= 0) {
394+
if ($transparentIndex >= 0 and $transparentIndex < imagecolorstotal($imageResource)) {
395395
return $transparentIndex;
396396
} elseif (IMAGETYPE_PNG === $fileType) {
397397
// assume that truecolor PNG has transparency

0 commit comments

Comments
 (0)