From: Ilia Alshanetsky Date: Tue, 4 Nov 2003 01:55:50 +0000 (+0000) Subject: Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results). X-Git-Tag: php-5.0.0b3RC1~780 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b520c9d42c34c30c353cc93579c92ab30f629ff4;p=php Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results). --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 540605a9a5..9b9413320c 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -255,7 +255,7 @@ int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a) gd = im->green[i] - g; bd = im->blue[i] - b; /* gd 2.02: whoops, was - b (thanks to David Marwood) */ - ad = im->blue[i] - a; + ad = im->alpha[i] - a; dist = rd * rd + gd * gd + bd * bd + ad * ad; if (first || (dist < mindist)) { mindist = dist;