Skip to content

Commit f651397

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #77700: Writing truecolor images as GIF ignores interlace flag
2 parents 10b4113 + 0d88388 commit f651397

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

ext/gd/libgd/gd_gif_out.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static int _gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
144144
BitsPerPixel = colorstobpp(tim->colorsTotal);
145145
/* All set, let's do it. */
146146
GIFEncode(
147-
out, tim->sx, tim->sy, tim->interlace, 0, tim->transparent, BitsPerPixel,
147+
out, tim->sx, tim->sy, interlace, 0, tim->transparent, BitsPerPixel,
148148
tim->red, tim->green, tim->blue, tim);
149149
if (pim) {
150150
/* Destroy palette based temporary image. */

ext/gd/tests/bug77700.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #77700 (Writing truecolor images as GIF ignores interlace flag)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('gd')) die('skip gd extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$im = imagecreatetruecolor(10, 10);
10+
imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255));
11+
imageinterlace($im, 1);
12+
imagegif($im, __DIR__ . 'bug77700.gif');
13+
14+
$im = imagecreatefromgif(__DIR__ . 'bug77700.gif');
15+
var_dump(imageinterlace($im));
16+
?>
17+
===DONE===
18+
--EXPECT--
19+
int(1)
20+
===DONE===
21+
--CLEAN--
22+
<?php
23+
unlink(__DIR__ . 'bug77700.gif');
24+
?>

0 commit comments

Comments
 (0)