libiff
libiff copied to clipboard
cant decode file created with an amiga program (source for pr0ggie included)
https://github.com/paigeadele/derp/raw/master/amiga.iff
if you want to play around and try to figure out why... https://github.com/paigeadele/derp/tree/master/screenshotutil
Error:
laptop erratic # /usr/local/bin/ilbm2acbm -i amiga.iff -o amiga.acbm
WARNING: Trailing IFF contents found: 66!
Chunk size mismatch! FORM size: -2147483647, while body has: 4
Invalid ILBM file!
laptop erratic # exit
amiga.iff /usr/local/bin/iffpp
laptop derp # /usr/local/bin/iffpp amiga.iff
WARNING: Trailing IFF contents found: 66!
Chunk size mismatch! FORM size: -2147483647, while body has: 4
laptop derp #
If you figure out why I'd be curious to hear about it I can only imagine it must be something brilliant
Hi,
If you run iffpp with the -c parameter (which disables validity checking) you will see the following output:
$ iffpp amiga.iff -c WARNING: Trailing IFF contents found: 66! 'FORM' = { chunkSize = -2147483647; formType = 'ILBM'; [ ]; }
As you may probably notice, there is something wrong with the FORM chunk size, because it's a negative value. I inspected the file with a hex editor and noticed that this value is congruent with what is actually inside the IFF file, so it's not caused by the parser library. The form chunk size should correspond to the cumulative size of all chunks stored inside it with padding bytes included. In this file this is not the case, so that's why it gets confused.
I think some Amiga programs might be able to open this file, because they probably ignore the FORM chunk size (or the FORM chunk entirely) and only look for the data chunks that it understands.
So technically the file is incorrect. To be able to open the file with libilbm or libiff, the chunk size in this file must be fixed or I must implement something that copes with these kind of errors :-)
On Wed, Mar 25, 2015 at 10:11 AM, Paige Thompson [email protected] wrote:
If you figure out why I'd be curious to hear about it I can only imagine it must be something brilliant
— Reply to this email directly or view it on GitHub https://github.com/svanderburg/libiff/issues/3#issuecomment-85944133.