texpresso icon indicating copy to clipboard operation
texpresso copied to clipboard

Fix decompression for images that have a height which is more than one block and not a multiple of 4

Open chieltbest opened this issue 1 year ago • 1 comments

The bounds checks for decompression seem to have been copied over from the compression algorithm, but the check has changed because of the block size division

chieltbest avatar Jul 13 '24 19:07 chieltbest

Thanks for pointing this out! Would you happen to have a small test file that could be added to lib/src/test_data.rs so we can keep an eye on this case in the test suite?

jansol avatar Aug 27 '24 23:08 jansol

I can confirm this with the following compressed bytes (dxt1, made with libsquish) 8E 73 71 8C AA AA AA AA 8E 73 71 8C AA AA FF FF It should decompress to 4x6 with each pixel being 0x7F7F7F.

Aerocatia avatar Oct 17 '24 12:10 Aerocatia

Awesome, thanks! I'll merge this and add a regression test with that data when I get to my PC which has the appropriate dev setup (might not happen until next week).

jansol avatar Oct 18 '24 13:10 jansol

Sorry, ended up bike shedding a bit more on the actual test implementation than I had planned.

jansol avatar Oct 31 '24 00:10 jansol