From 41fb0eaa116da34fa531437d5b87ca73089e4944 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 6 Mar 2019 00:27:16 +0100 Subject: Fix #77700: Writing truecolor images as GIF ignores interlace flag We revert the interlace flag related part of commit ff2822a[1], since contrary to the transparent color, the interlace flag is not retained by `gdImageCreatePaletteFromTrueColor()`. This also matches upstream libgd. [1] --- ext/gd/libgd/gd_gif_out.c | 2 +- ext/gd/tests/bug77700.phpt | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 ext/gd/tests/bug77700.phpt (limited to 'ext/gd') diff --git a/ext/gd/libgd/gd_gif_out.c b/ext/gd/libgd/gd_gif_out.c index 1f2a6b936a..cd4ea1529b 100644 --- a/ext/gd/libgd/gd_gif_out.c +++ b/ext/gd/libgd/gd_gif_out.c @@ -132,7 +132,7 @@ void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out) BitsPerPixel = colorstobpp(tim->colorsTotal); /* All set, let's do it. */ GIFEncode( - out, tim->sx, tim->sy, tim->interlace, 0, tim->transparent, BitsPerPixel, + out, tim->sx, tim->sy, interlace, 0, tim->transparent, BitsPerPixel, tim->red, tim->green, tim->blue, tim); if (pim) { /* Destroy palette based temporary image. */ diff --git a/ext/gd/tests/bug77700.phpt b/ext/gd/tests/bug77700.phpt new file mode 100644 index 0000000000..07b7ffbbba --- /dev/null +++ b/ext/gd/tests/bug77700.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #77700 (Writing truecolor images as GIF ignores interlace flag) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(1) +===DONE=== +--CLEAN-- + -- cgit v1.2.1