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

NEWS
ext/gd/libgd/gd.c

diff --git a/NEWS b/NEWS
index 5bb30c792b2fc910b3e37a4d44104c13607fcd36..fbcb8a8cc1d1f1bd735b1fc6708fa9123653670a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP 4                                                                      NEWS
 ?? ??? 2003, Version 4.3.5
 - Fixed header handler in NSAPI SAPI module (header->replace was ignored,
   send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results).
+  (sprice at wisc dot edu, Ilia)
 - Fixed bug #26042 (memory leak if mcrypt_generic_deinit() is not called 
   after every mcrypt_generic_init() call). (Ilia)
 - Fixed bug #26025 (Segfault on glob() without GLOB_NOCHECK or GLOB_NOMAGIC
index 0befc9074ff7053e2fd264505150f7460710d812..c74d55d0290f99b0fe78055eda24b1eef9218150 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;