Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: invalid code in LZW stream. #191

Open
Aerocatia opened this issue Nov 19, 2022 · 2 comments
Open

Error: invalid code in LZW stream. #191

Aerocatia opened this issue Nov 19, 2022 · 2 comments

Comments

@Aerocatia
Copy link

Hi

The attached TIFF triggers an error related the the LZW compression, but libtiff will decode this.
It was created with Paint.NET. It works after re-saving it with GIMP.

If the LZW steam is indeed invalid then that is acceptable, bit it would be interesting to know why.

b40_fog_noise.zip

@HeroicKatora
Copy link
Member

The offending chunk seems to be chunk 4 (rows 36-44). chunk-4.tar.gz. That seems to be invalid when running it though both weezl and salzweg using the tiff size switch and 8-bit MSB encoding as specified in the tiff specification as LZW compression. Not sure if the library or myself is doing something wrong in identifying the right bits?

@fintelia
Copy link
Contributor

I have vague recollections of tracking down a bug like this that ended up being caused by libtiff only pulling the needed number of bytes from the LZW stream and not checking that anything after that was valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants