From b520c9d42c34c30c353cc93579c92ab30f629ff4 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 4 Nov 2003 01:55:50 +0000 Subject: [PATCH] Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results). --- ext/gd/libgd/gd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.50.1