mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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] <http://git.php.net/?p=php-src.git;a=commit;h=ff2822a82b740edb8ccf307f080bae188c200fb9>
This commit is contained in:
parent
0e836f523a
commit
41fb0eaa11
3 changed files with 29 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -18,6 +18,10 @@ PHP NEWS
|
||||||
. Fixed bug #50020 (DateInterval:createDateFromString() silently fails).
|
. Fixed bug #50020 (DateInterval:createDateFromString() silently fails).
|
||||||
(Derick)
|
(Derick)
|
||||||
|
|
||||||
|
- GD:
|
||||||
|
. Fixed bug #77700 (Writing truecolor images as GIF ignores interlace flag).
|
||||||
|
(cmb)
|
||||||
|
|
||||||
- MySQLi:
|
- MySQLi:
|
||||||
. Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita)
|
. Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita)
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
|
||||||
BitsPerPixel = colorstobpp(tim->colorsTotal);
|
BitsPerPixel = colorstobpp(tim->colorsTotal);
|
||||||
/* All set, let's do it. */
|
/* All set, let's do it. */
|
||||||
GIFEncode(
|
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);
|
tim->red, tim->green, tim->blue, tim);
|
||||||
if (pim) {
|
if (pim) {
|
||||||
/* Destroy palette based temporary image. */
|
/* Destroy palette based temporary image. */
|
||||||
|
|
24
ext/gd/tests/bug77700.phpt
Normal file
24
ext/gd/tests/bug77700.phpt
Normal 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');
|
||||||
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue