diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 6a2e8fbcd1f..bb12cefc0cd 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 00000000000..01adaa32c67 --- /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 +