1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00

MFH: Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect

results).
This commit is contained in:
Ilia Alshanetsky
2003-11-04 01:56:07 +00:00
parent 038e99660f
commit 00203d2968
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@@ -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

View 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;