It's my own development, but for a different target. I was using the LZW encoder with a specially crafted tool, and after that adapted it for GIF. If really necessary user_write() callback could be removed.
OK. I don't see a need to change it, it just made me wonder where the code came from.
If possible, I would prefer not to maintain an implementation of LZW compression.
Why? It's plain and simple. In comparison LZW decoder is more complicated, but we have it included.
That was before my time, I just moved it from the old olepicture code. I don't know what the rationale was for importing gif decompression code.
Surprisingly, I can't find a library we could use for LZW compression, so maybe we do need to include it. We could add a dependency on a gif library, but that doesn't seem worth it to me.