diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index d7379ae1de9..2a1b5563b3d 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -932,7 +932,9 @@ static int gdImageTileGet (gdImagePtr im, int x, int y) srcy = y % gdImageSY(im->tile); p = gdImageGetPixel(im->tile, srcx, srcy); - if (im->trueColor) { + if (p == im->tile->transparent) { + tileColor = im->transparent; + } else if (im->trueColor) { if (im->tile->trueColor) { tileColor = p; } else { diff --git a/ext/gd/tests/gh17349.phpt b/ext/gd/tests/gh17349.phpt new file mode 100644 index 00000000000..cd0fc4317b5 --- /dev/null +++ b/ext/gd/tests/gh17349.phpt @@ -0,0 +1,27 @@ +--TEST-- +GH-17349 (Tiled truecolor filling looses single color transparency) +--EXTENSIONS-- +gd +--FILE-- + +--EXPECT-- +The images are equal. diff --git a/ext/gd/tests/gh17349.png b/ext/gd/tests/gh17349.png new file mode 100644 index 00000000000..dd75d9df990 Binary files /dev/null and b/ext/gd/tests/gh17349.png differ