1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 10:15:28 +02:00
This commit is contained in:
Ryan Cramer
2021-01-22 14:18:17 -05:00
parent 76128e4855
commit 0c0fb16e4d

View File

@@ -862,7 +862,8 @@ class ImageSizerEngineGD extends ImageSizerEngine {
} else if($this->imageType == IMAGETYPE_GIF) {
// @mrx GIF transparency
$transparentIndex = imagecolortransparent($image);
$transparentColor = $transparentIndex != -1 ? @imagecolorsforindex($image, $transparentIndex) : 0;
// $transparentColor = $transparentIndex != -1 ? @imagecolorsforindex($image, $transparentIndex) : 0;
$transparentColor = $transparentIndex != -1 ? imagecolorsforindex($image, ($transparentIndex < imagecolorstotal($image) ? $transparentIndex : $transparentIndex - 1)) : 0;
if(!empty($transparentColor)) {
$transparentNew = imagecolorallocate($im, $transparentColor['red'], $transparentColor['green'], $transparentColor['blue']);
$transparentNewIndex = imagecolortransparent($im, $transparentNew);