On Tue, 03 Jan 2012 00:54:09 +0900
"Stephen J. Turnbull" <stephen(a)xemacs.org> wrote:
Are you guys seriously proposing that we special-case this one
particular bogus file? By simply silently ignoring the error?
Correct. Because of the design of image gifs (I don't want to get into
text gifs and other weird types) the terminator char is really just a
warm fuzzy. It is required by the spec, but not required to properly
display the gif.
At a very high level, the format on an image gif is:
headers
image block(s)
0x00 terminator
0x3b terminator
Basically, you loop through the image blocks until you get a size of 0.
If you see the 0, the image is done. The 0x3b just confirms that.
(AFAICS the statement "mem->len = 0;" tells giflib that
there's no
data there, no?)
No. The UserData is not used in giflib. That struct is for
gif_read_from_memory only. I set the len to 0 so that we don't
provide 0x3b more than once. I don't think it would happen, but I am
paranoid that way ;) I believe it could be safely left out.
I was actually quite surprised that the image viewers and browsers I
tried handled the broken gif. But I guess that is why they get away
with it.
And I was wrong about emacs. It just handles the error differently, it
will not display a gif without a terminator. It looks like it draws an
empty square.
Cheers,
Sean
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta