mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
* PHP-8.4: Add support for reading GIFs without colormap
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user