BigGustave icon indicating copy to clipboard operation
BigGustave copied to clipboard

Adam7 fails for paletted images

Open ThomasHoevel opened this issue 2 years ago • 2 comments

logo.zip

When opening the attached image after applying the patch from issue #13 (https://github.com/EliotJones/BigGustave/issues/13#issue-1780247532), the library fails while reading the image. The image is interlaced using Adam7.

ThomasHoevel avatar Feb 08 '24 12:02 ThomasHoevel

Update: The image dimensions are 360x180. Decoder allocates 360x180 bytes for the image. RawPngData calculates with 361 bytes per row and hits an Index out of range exception.

ThomasHoevel avatar Feb 12 '24 09:02 ThomasHoevel

I updated the code to make it work by conditionally adding "1" add two places for the image with color palette. Our interleaved true-color test image only works without adding 1. I don't know if this works for all images. See PR #17.

ThomasHoevel avatar Apr 11 '24 12:04 ThomasHoevel