bluescan / tacentview

An image and texture viewer for tga, png, apng, exr, dds, pvr, ktx, ktx2, astc, pkm, qoi, gif, hdr, jpg, tif, ico, webp, and bmp files. Uses Dear ImGui, OpenGL, and Tacent. Useful for game devs as it displays information like the presence of an alpha channel and querying specific pixels for their colour.
ISC License
329 stars 32 forks source link

.tga 'top-down' bit seems to be ignored #169

Closed applecuckoo closed 2 months ago

applecuckoo commented 2 months ago

Hi there, I was ripping some game sprites and found that some .tga files were showing up vertically flipped compared to other tools (i.e. gThumb, GIMP, etc.)

I did a bit of digging and it seems like Tacent View is ignoring bit 5 of byte 0x11, which indicates if the image's origin is at the top and bottom. (By the way, I'd assume bit 4 of the same byte, for left and right, is being ignored too.) Some example files with bit 5 turned on are attached.

targa_files.zip

bluescan commented 2 months ago

Thanks for the report and example files. That's probably exactly what's happening. Will fix when get enough time.

bluescan commented 2 months ago

Hi applecuckoo. This is fixed in e1f07b2099522b522a2a03f21862a9b99a11a668. Both H and V flip bits are respected, I'll probably do a release in the next few days (or, of course build manually to get it).