mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add support for reading GIFs without colormap
Cf. <fc38677e80
>.
Closes GH-17364.
This commit is contained in:
parent
91384e561f
commit
38365a44d0
4 changed files with 17 additions and 2 deletions
2
NEWS
2
NEWS
|
@ -22,6 +22,8 @@ PHP NEWS
|
|||
images). (cmb)
|
||||
. Ported fix for libgd 223 (gdImageRotateGeneric() does not properly
|
||||
interpolate). (cmb)
|
||||
. Added support for reading GIFs without colormap to bundled libgd. (Andrew
|
||||
Burley, cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug GH-11874 (intl causing segfault in docker images). (nielsdos)
|
||||
|
|
|
@ -244,8 +244,10 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
|
|||
BitSet(buf[8], INTERLACE), &ZeroDataBlock);
|
||||
} else {
|
||||
if (!haveGlobalColormap) {
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
// Still a valid gif, apply simple default palette as per spec
|
||||
ColorMap[CM_RED][1] = 0xff;
|
||||
ColorMap[CM_GREEN][1] = 0xff;
|
||||
ColorMap[CM_BLUE][1] = 0xff;
|
||||
}
|
||||
ReadImage(im, fd, width, height,
|
||||
ColorMap,
|
||||
|
|
BIN
ext/gd/tests/gif_nocolormaps.gif
Normal file
BIN
ext/gd/tests/gif_nocolormaps.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 B |
11
ext/gd/tests/gif_nocolormaps.phpt
Normal file
11
ext/gd/tests/gif_nocolormaps.phpt
Normal file
|
@ -0,0 +1,11 @@
|
|||
--TEST--
|
||||
A GIF without any Global or Local color tables is still decoded
|
||||
--EXTENSIONS--
|
||||
gd
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatefromgif(__DIR__ . "/gif_nocolormaps.gif");
|
||||
var_dump($im instanceof GdImage);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
Loading…
Add table
Add a link
Reference in a new issue