From: Pierre Joye Date: Sun, 23 Jul 2006 21:41:12 +0000 (+0000) Subject: - #38179, imagecopy, palette to truecolor must use alpha channel too X-Git-Tag: php-5.2.0RC1~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=261beb0326257f247bedfb5e4ba3fac9ca22ca64;p=php - #38179, imagecopy, palette to truecolor must use alpha channel too --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 6a2e8fbcd1..bb12cefc0c 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -2161,7 +2161,7 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, for (x = 0; (x < w); x++) { int c = gdImageGetPixel (src, srcX + x, srcY + y); if (c != src->transparent) { - gdImageSetPixel (dst, dstX + x, dstY + y, gdTrueColor(src->red[c], src->green[c], src->blue[c])); + gdImageSetPixel(dst, dstX + x, dstY + y, gdTrueColorAlpha(src->red[c], src->green[c], src->blue[c], src->alpha[c])); } } } diff --git a/ext/gd/tests/38179.phpt b/ext/gd/tests/38179.phpt new file mode 100644 index 0000000000..01adaa32c6 --- /dev/null +++ b/ext/gd/tests/38179.phpt @@ -0,0 +1,28 @@ +--TEST-- +imagecopy doen't copy alpha, palette to truecolor +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +46FF0000 +