rofl0r / agsutils

contains utils for AGS: game extractor, repacker, disassembler and assembler
44 stars 14 forks source link

Broken TGA header #19

Closed faragher closed 2 years ago

faragher commented 2 years ago

Extracting sprites from Primordia.

Gimp and Windows Photo throw an error opening the files produced by AGSprite. This is caused by two errant bytes, one in field 4 and one in field 5 (as referenced on Wikipedia).

Byte at 0x8 is Colormap BPP, this should be at 0x7. Overall BPP is at 0x13 should be at 0x11.

Removing one zero byte from 0x3-0x5 and the zero byte at 0x8 (after removing the first byte) allows the TGA to load successfully. Looking at the byte order of the TGA standard (lo-hi) this appears to be the correct solution.

This may be a compiler issue as well: http://www.paulbourke.net/dataformats/tga/

Unfortunately, repairing this is way above my skill level, I am not a C coder and don't understand how the code generates this bitstream.

Using Windows binaries from agsutils-0.9.5-win32.zip.

rofl0r commented 2 years ago

should be fixed via https://github.com/rofl0r/agsutils/releases/download/v0.9.6/agsutils-0.9.6-win32.zip

thanks for report