How to tell if a Targa is from Photoshop?

222 views Asked by At

I have run into an issue while trying to write a *.tga file reader. For 32 bit targas, photoshop fills the alpha channel with 255, which is still standard, and works, but in 16 bit targas, photoshop fills the alpha bit with zeros.

Is there any way I can tell that a Targa has come from Photoshop so I can fill the alpha bit with 1s?

1

There are 1 answers

1
buc On

The version 2.0 specification of the Targa file format contains a so called Extension area which has a Software ID field. This field holds the name of the application that created the file.

Maybe you could check whether Photoshop produces version 2.0 Targa files, and if it does what Software ID does it write to this specific field, then in your application check for this ID.

As Targa 1.0 file format does not have such a field, I'm not sure whether detecting Photoshop is possible at all.