mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Attempt fix for processwire/processwire-issues#1299 using @adrianbj suggestion
This commit is contained in:
@@ -862,12 +862,13 @@ class ImageSizerEngineGD extends ImageSizerEngine {
|
|||||||
} else if($this->imageType == IMAGETYPE_GIF) {
|
} else if($this->imageType == IMAGETYPE_GIF) {
|
||||||
// @mrx GIF transparency
|
// @mrx GIF transparency
|
||||||
$transparentIndex = imagecolortransparent($image);
|
$transparentIndex = imagecolortransparent($image);
|
||||||
// $transparentColor = $transparentIndex != -1 ? @imagecolorsforindex($image, $transparentIndex) : 0;
|
if($transparentIndex >= 0 && $transparentIndex < imagecolorstotal($image)) {
|
||||||
$transparentColor = $transparentIndex != -1 ? imagecolorsforindex($image, ($transparentIndex < imagecolorstotal($image) ? $transparentIndex : $transparentIndex - 1)) : 0;
|
$transparentColor = imagecolorsforindex($image, $transparentIndex);
|
||||||
if(!empty($transparentColor)) {
|
if(!empty($transparentColor)) {
|
||||||
$transparentNew = imagecolorallocate($im, $transparentColor['red'], $transparentColor['green'], $transparentColor['blue']);
|
$transparentNew = imagecolorallocate($im, $transparentColor['red'], $transparentColor['green'], $transparentColor['blue']);
|
||||||
$transparentNewIndex = imagecolortransparent($im, $transparentNew);
|
$transparentNewIndex = imagecolortransparent($im, $transparentNew);
|
||||||
imagefill($im, 0, 0, $transparentNewIndex);
|
imagefill($im, 0, 0, $transparentNewIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user