莫红波
2015-10-09 05:04:01 UTC
The command:
gm identify test.gif
The output in terminal:
gm identify: Corrupt image (test.gif)
However, Imagemagicks does well.
So, I gdb GM and IM and then I found the difference.
In GM.1.3.22 coders/gif.c:
1011 if (opacity >= (long) image->colors)
1012 image->colors=opacity+1;
In IM:
1259 if (opacity >= (ssize_t) image->colors)
1260 opacity=(-1);
------
This difference will cause mistakes when allocating local colormaps.
Moreover I scaned spec-gif89a.txt
<http://www.w3.org/Graphics/GIF/spec-gif89a.txt> and didn't find anything
about this. So I'm not sure whether it's a bug.
image URL: Loading Image...
gm identify test.gif
The output in terminal:
gm identify: Corrupt image (test.gif)
However, Imagemagicks does well.
So, I gdb GM and IM and then I found the difference.
In GM.1.3.22 coders/gif.c:
1011 if (opacity >= (long) image->colors)
1012 image->colors=opacity+1;
In IM:
1259 if (opacity >= (ssize_t) image->colors)
1260 opacity=(-1);
------
This difference will cause mistakes when allocating local colormaps.
Moreover I scaned spec-gif89a.txt
<http://www.w3.org/Graphics/GIF/spec-gif89a.txt> and didn't find anything
about this. So I'm not sure whether it's a bug.
image URL: Loading Image...