robinlinden / hastur

A web browser.
BSD 2-Clause "Simplified" License
31 stars 10 forks source link

lzw decompression #906

Open robinlinden opened 8 months ago

robinlinden commented 8 months ago

This is needed both for GIF decoding and Content-Encoding: compress.

Zer0-One commented 6 months ago

It looks like there are enough variants of LZW that writing one implementation that can be used for compress'd data, GIFs, PDF, etc may be tricky.

robinlinden commented 6 months ago

Didn't notice you'd assigned yourself this. I worked a bit on this back when I was setting up the GIF stuff, but I don't recall what state it's in.

My plan back then was that archive/lzw would just be plain lzw but with support for either being big-endian or little-endian, and then just make sure that there is a method for the GIF-encoder/decoder to be able to handle the control commands and e.g. reset the dictionary or whatever else needs doing.

Zer0-One commented 6 months ago

Oh, I didn't realize you already had some code written. I'll let you finish this one, and I'll do zstd in the meantime.