Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #77700: Writing truecolor images as GIF ignores interlace flag
This commit is contained in:
Christoph M. Becker 2019-03-06 00:38:40 +01:00
commit bc7a871982
2 changed files with 25 additions and 1 deletions

View File

@ -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. */

View File

@ -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');
?>