diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-03-06 00:38:40 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-03-06 00:38:40 +0100 |
commit | bc7a871982ec182738868aef0a7ad775d9f2362e (patch) | |
tree | 007cbb8eb6a7fa5298928845b35b15f8206965cd | |
parent | 824efb726c52117dbc146c4251480ce993dce771 (diff) | |
parent | f651397b1f874a09a7d3885a7463cdf8ea6eafa7 (diff) | |
download | php-git-bc7a871982ec182738868aef0a7ad775d9f2362e.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix #77700: Writing truecolor images as GIF ignores interlace flag
-rw-r--r-- | ext/gd/libgd/gd_gif_out.c | 2 | ||||
-rw-r--r-- | ext/gd/tests/bug77700.phpt | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/ext/gd/libgd/gd_gif_out.c b/ext/gd/libgd/gd_gif_out.c index 2e1f38af70..60f34ddc27 100644 --- a/ext/gd/libgd/gd_gif_out.c +++ b/ext/gd/libgd/gd_gif_out.c @@ -144,7 +144,7 @@ static int _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-- +<?php +if (!extension_loaded('gd')) die('skip gd extension not available'); +?> +--FILE-- +<?php +$im = imagecreatetruecolor(10, 10); +imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255)); +imageinterlace($im, 1); +imagegif($im, __DIR__ . 'bug77700.gif'); + +$im = imagecreatefromgif(__DIR__ . 'bug77700.gif'); +var_dump(imageinterlace($im)); +?> +===DONE=== +--EXPECT-- +int(1) +===DONE=== +--CLEAN-- +<?php +unlink(__DIR__ . 'bug77700.gif'); +?> |