diff --git a/ext/gd/libgd/gd_crop.c b/ext/gd/libgd/gd_crop.c index 676545c4dbc92..2791dac10e37e 100644 --- a/ext/gd/libgd/gd_crop.c +++ b/ext/gd/libgd/gd_crop.c @@ -92,7 +92,7 @@ gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode) switch (mode) { case GD_CROP_TRANSPARENT: - color = gdImageGetTransparent(im); + color = gdImageGetTransparent(im) & 0x7f000000; break; case GD_CROP_BLACK: diff --git a/ext/gd/tests/gh13163.phpt b/ext/gd/tests/gh13163.phpt new file mode 100644 index 0000000000000..7daf59c62c5b3 --- /dev/null +++ b/ext/gd/tests/gh13163.phpt @@ -0,0 +1,13 @@ +--TEST-- +GH-13163 (imagecrop on transparent background) +--EXTENSIONS-- +gd +--FILE-- +