Skip to content

Commit 0d88388

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fix #77700: Writing truecolor images as GIF ignores interlace flag
2 parents 72bfb25 + 41fb0ea commit 0d88388

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ PHP NEWS
1414
. Fixed bug #77677 (FPM fails to build on AIX due to missing WCOREDUMP).
1515
(Kevin Adler)
1616

17+
- GD:
18+
. Fixed bug #77700 (Writing truecolor images as GIF ignores interlace flag).
19+
(cmb)
20+
1721
- MySQLi:
1822
. Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita)
1923

ext/gd/libgd/gd_gif_out.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
132132
BitsPerPixel = colorstobpp(tim->colorsTotal);
133133
/* All set, let's do it. */
134134
GIFEncode(
135-
out, tim->sx, tim->sy, tim->interlace, 0, tim->transparent, BitsPerPixel,
135+
out, tim->sx, tim->sy, interlace, 0, tim->transparent, BitsPerPixel,
136136
tim->red, tim->green, tim->blue, tim);
137137
if (pim) {
138138
/* 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)