From: Ilia Alshanetsky Date: Fri, 20 Dec 2002 03:44:41 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.0RC4~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f81e61297682a2d9f1d472de7c5bf8af53d2d3fc;p=php MFH --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 0794ab5467..fee7687be0 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -566,21 +566,19 @@ gdImageColorDeallocate (gdImagePtr im, int color) im->open[color] = 1; } -void -gdImageColorTransparent (gdImagePtr im, int color) +void gdImageColorTransparent (gdImagePtr im, int color) { - if (!im->trueColor) - { - if (im->transparent != -1) - { - im->alpha[im->transparent] = gdAlphaOpaque; - } - if (color != -1) - { - im->alpha[color] = gdAlphaTransparent; + if (!im->trueColor) { + if (im->transparent != -1) { + im->alpha[im->transparent] = gdAlphaOpaque; + } + if (color > -1 && color <= gdMaxColors) { + im->alpha[color] = gdAlphaTransparent; + } else { + return; + } } - } - im->transparent = color; + im->transparent = color; } void