2005.03.03 19:19 "Re: [Tiff] LibTIFF question", by Bob Friesenhahn

2005.03.03 19:27 "Re: [Tiff] LibTIFF question", by Frank Warmerdam

Is there any way to quench the "unknown tag" errors if the application plans to handle them? It would be nice if there was a way for the application to tell libtiff in advance that it is going to handle certain tags.

Bob,

Certainly. Predefine the tags with TIFFMergeFieldInfo. The tricky part is that each TIFF file instance carries a list of tag definitions and you need to pre-define them as part of the open process before tags start to get processed.

This works by installing a tag extender that will be invoked for each TIFF file opened. The GeoTIFF library does this with the bulk of the code of interest being found in libgeotiff/xtiff.c which I am appending for people to review.

I wrote up some of this in the Libtiff docs at:

http://www.remotesensing.org/libtiff/addingtags.html

This is a subtopic of the "Modifying the TIFF Library" page on the web site.

I would agree that the TIFFGetField() man page needs to be updated to reflect how it behaves for tags that have not been predefined.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent