File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/internal/Magento/Framework/Image/Adapter Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,12 @@ private function applyTransparency(&$imageResourceTo, $transparentIndex): void
344344 $ transparentColor = false ;
345345
346346 if ($ transparentIndex >= 0 && $ transparentIndex <= imagecolorstotal ($ this ->_imageHandler )) {
347- list ($ red , $ green , $ blue ) = array_values (imagecolorsforindex ($ this ->_imageHandler , $ transparentIndex ));
348- $ transparentColor = imagecolorallocate ($ imageResourceTo , (int ) $ red , (int ) $ green , (int ) $ blue );
347+ try {
348+ $ colorsForIndex = imagecolorsforindex ($ this ->_imageHandler , $ transparentIndex );
349+ list ($ red , $ green , $ blue ) = array_values ($ colorsForIndex );
350+ $ transparentColor = imagecolorallocate ($ imageResourceTo , (int ) $ red , (int ) $ green , (int ) $ blue );
351+ } catch (\ValueError $ e ) {
352+ }
349353 }
350354 if (false === $ transparentColor ) {
351355 throw new \InvalidArgumentException ('Failed to allocate transparent color for image. ' );
You can’t perform that action at this time.
0 commit comments