diff --git a/NEWS b/NEWS index 9d6235205b0..411f81e4b5e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2016, PHP 7.1.0RC1 +-GD: + . Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor + images). (cmb) + - Reflection: . Reverted prepending \ for class names and ? for nullable types returned from ReflectionType::__toString(). (Trowski) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 51258d484f4..3ad51ada4bb 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -2245,7 +2245,9 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, for (y = 0; (y < h); y++) { for (x = 0; (x < w); x++) { int c = gdImageGetTrueColorPixel (src, srcX + x, srcY + y); - gdImageSetPixel (dst, dstX + x, dstY + y, c); + if (c != src->transparent) { + gdImageSetPixel (dst, dstX + x, dstY + y, c); + } } } } else { diff --git a/ext/gd/tests/bug66005.phpt b/ext/gd/tests/bug66005.phpt new file mode 100644 index 00000000000..a01c5c32b85 --- /dev/null +++ b/ext/gd/tests/bug66005.phpt @@ -0,0 +1,35 @@ +--TEST-- +Bug #66005 (imagecopy does not support 1bit transparency on truecolor images) +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +9b36049de01006b367efd433f1689043 +==DONE==