Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check the TIFF type?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
571
US
Colleagues,
Not sure this is the place for this question, but I dunno where else...
I hope you're all familiar with the TIFF image file format.
TIFF may store raster image of bilevel (B&W) format, grayscale format, or color (palette or full RGB).
It can also have this image info As-Is, or compressed (LZW or ZIP).
Here's the question:
Is there a way to programmatically extract this above information from a TIFF file on disk? E.g. - B&W or RGB? Compressed oar not?

TIA!


Regards,

Ilya
 
You may want to Google something like "vb net tiff file attributes"

This is one of the hits I've got. Looks interesting...

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
I ran search for "TIFF file header" - nothing useful came back.
The one you've provided does look promising - thank you!

But!
To try it requires downloading and installing and registering an OCX - which policy of the company I work for forbids. :-(

Actually, I was hoping to find the info on where these TIFF file attributes (e.g. color scheme and compression type and ratio) are stored in the file itself, so I could extract it.
Any idea on how-to?

Regards,

Ilya
 
A System.Drawing.Bitmap contains the following properties:

PropertyIDList

which contains a list of 'well-known' image property IDs. Ypu need to match the ID to a proper string. The TIFF IDs are documented by Adobe in (check the appendix)

PrropertyItems

which is a collection of ProprtyItems; a ProprtyItem maps the ID to an ac tual value - but not directly - it contains the ID, the the length (in bytes) of the Value, the types of the value, and the value itself - you need to determine the type, and then interpret the raw Value as that type ... (the types are outlined here:
Good luck ...

Of course one question would be - why do you need this TIFF metadata?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top