]> granicus.if.org Git - php/commitdiff
Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 4 Nov 2003 01:55:50 +0000 (01:55 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 4 Nov 2003 01:55:50 +0000 (01:55 +0000)
ext/gd/libgd/gd.c

index 540605a9a5318a0063005db7748eede7d688144c..9b9413320cb6e6d9084e5be915ce4c9654ca9292 100644 (file)
@@ -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;