2005.02.25 08:21 "[Tiff] How to get a thumbnail View for a single page TIFF file.", by Priyanshu Sharma

2005.02.25 10:50 "Re: [Tiff] How to get a thumbnail View for a single page TIFF file.", by Joris Van Damme

Priyanshu,

if I comment out this function call from the code "TIFFSetField(out, TIFFTAG_SUBIFD, 1, diroff);" ( its present in the function defination of ShowThumbnail() function ) and set the page no i want to view as thumbnail by function TIFFSetDirectory().

I'm not sure what the problem is here, I'm not sure what code you are referring to, nor what your intentions are.

I am getting 2 pages tiff file where first page is the thumbnail for the required page and second page is the actuall page for which i want the thumbnail view.

Sometimes, tiff writer apps do that. It's evil, for three reasons

This being said, I often encounter such a TIFF. Apart from grumbling and nagging, an possibly throwing stuff at a person that happens to be nearby, there's nothing much we can do about it... ;-) The only logical thing code can do, is treat it as a regular two page TIFF, instead of a single page TIFF that is enriched with a thumbnail or something, since it cannot detect it is not a regular two page TIFF with two logically independent pages.

Or perhaps not... If there are two pages in a file, you could see if the NewSubfileType and/or the SubfileType tag (http://www.awaresystems.be/imaging/tiff/tifftags/newsubfiletype.html and http://www.awaresystems.be/imaging/tiff/tifftags/subfiletype.html) have certain values, and try to deduct something from that. It's not the logical thing to do, and has the added dissadvantage that one has to try to read two IFDs to make sense of the first one, but it could perhaps be regarded the most 'reality-compatible' way to deal with it. This does not however invalidate the above mentioned reasons why the situation is evil, and TIFF writers should be made not to produce this kind of TIFFs and use the SubIFDs tag instead.

i am not able to find relevent information abt tag no 330 also.. if any one has some thing relevent plz post it or mail it to me.

There's a tag search page, http://www.awaresystems.be/imaging/tiff/tifftags/search.html, where you can enter just about anything like tag name, or, in this case, decimal tag number. Searching for 330 there, yields the SubIFDs tag page http://www.awaresystems.be/imaging/tiff/tifftags/subifds.html. On that page, there's a short explanation, and a link to the specification supplement 1 that I referred to earlier. That specification suppelement fully defines the SubIFDs tag.

Best regards;

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html