News for hackers. Stuff that matters.
Re:The Treachery of Image Files by jradd on Wednesday September 09, 2020 @03:19AM (#24418224)
I wonder if there are any real programmers out there who have decoded GIF by hand. The IETF is clear that the header should be 6 7bit bytes (GIF##a), and the ends with `\x00\x3b`.

without LZW, it should be trivial to append a frame to an image. its so hard... instead of downvoting me, does anyone know of a good/simple example of this in C/python or anything? array2gif[1] is pretty close.

1: https://github.com/tanyaschlusser/array2gif

Re:The Treachery of Image Files by 082349872349872 on Wednesday September 09, 2020 @05:21AM (#24419041)
Don't know a simple example: when I did trivial encoding[1], it was by reading the spec. Dim memories for keeping it simple: choose an advantageous bit depth and palette so your non-lzw'd data can trivially be written out bytewise per pixel. If you can control width to avoid line padding, even better.

(Yet dimmer, possibly false, memories: by taking advantage of LZW literals, I think it's possible to unencodedly write supposedly encoded blocks?)

[1] 10-50 lines of python, depending upon fanciness, IIRC