From 799e6c0e9876d49596fccdc6e00c6dba38ba69b6 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sat, 4 Nov 2006 02:23:45 +0000 Subject: [PATCH] - MFB: #39273, imagecopyresized and alpha channel --- ext/gd/libgd/gd.c | 2 +- ext/gd/tests/bug39273.phpt | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ext/gd/tests/bug39273.phpt diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 14dcc110c7..ff2b0596f5 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -754,7 +754,7 @@ int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) int p = gdImageGetPixel(im, x, y); if (!im->trueColor) { - return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : gdAlphaOpaque); + return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : im->alpha[p]); } else { return p; } diff --git a/ext/gd/tests/bug39273.phpt b/ext/gd/tests/bug39273.phpt new file mode 100644 index 0000000000..4384500447 --- /dev/null +++ b/ext/gd/tests/bug39273.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #37360 (gdimagecreatefromgif, bad image sizes) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +32FF0000 -- 2.50.1