2006.02.06 17:42 "Re: [Tiff] Mega newbie question", by Joris Van Damme
I have been reading the docs at awaresystems.com on accessing the
> PhotoShop thumbnails within a tiff file.
That's .be, man... http://www.awaresystems.be/. Not all that glitters, is .com.
I am not sure what I am getting back from GetField. If I run the program below I get
Value of GetField = 10124416
Does that mean that the length of the block is 10124416 bytes? Or
it's unique identifier? this just
See section 'AUTOREGISTERED TAGS' on http://www.remotesensing.org/libtiff/man/TIFFGetField.3tiff.html.
If you can't find the tag in the table above that means this is unsupported tag. But you still be able to read it's value if you know the data type of that tag. For example, if you want to read the LONG value from the tag 33424 and ASCII string from the tag 36867 you can use the following code:
TIFFGetField(tiff, 33424, &count, &data); printf("Tag %d: %d, count %d0, 33424, *(uint32 *)data, count); TIFFGetField(tiff, 36867, &count, &data); printf("Tag %d: %s, count %d0, 36867, (char *)data, count);
I'm not too sure why count is declared uint16 here... It should be uint32 if you ask me. Plenty of tags have potentially over 64K of data, and in any case, the count in tags in actual file normal TIFF (not BigTIFF) is unsigned 32bit. I'm also unsure why datatype is not returned by this interface... I think it should be if it is to be used in a robust manner. Otherwise, if the calling code supposes LONG datatype, but the actual (possibly invalid) file states BYTE datatype, calling code is next going to boom in an access violation when accessing past 1/4 of what is supposes is actual data.
Good luck. Don't be shy to post your results, I would welcome any good actual code contribution to the Photoshop tag page.
Joris Van Damme
Download your free TIFF tag viewer for windows here: