AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.03.03 17:19 "LibTIFF question", by Kalman Miklos
2005.03.03 17:48 "Re: LibTIFF question", by Frank Warmerdam
2005.03.03 18:04 "Re: LibTIFF question", by Bob Friesenhahn
2005.03.03 18:11 "Re: LibTIFF question", by Kalman Miklos
2005.03.03 18:28 "Re: LibTIFF question", by Frank Warmerdam
2005.03.03 19:19 "Re: LibTIFF question", by Bob Friesenhahn
2005.03.03 19:27 "Re: LibTIFF question", by Frank Warmerdam
2005.03.15 00:38 "Re: LibTIFF question", by Joris Van Damme
2005.03.15 07:56 "Re: LibTIFF question", by Frank Warmerdam
2005.03.15 16:06 "Re: LibTIFF question", by Joris Van Damme
2005.03.15 16:15 "Re: LibTIFF question", by Frank Warmerdam
2005.03.15 16:34 "Re: LibTIFF question", by Bob Friesenhahn

2005.03.15 07:56 "Re: LibTIFF question", by Frank Warmerdam

On Tue, 15 Mar 2005 01:38:39 +0100, Joris <joris.at.lebbeke@skynet.be> wrote:
> 
> So my question is, is there a way to retrieve the datatype of these
> auto-registered tags? Am I right in thinking that TIFFFindFieldInfo with
> TIFF_ANY for the third parameter returns the 'registration' structure as build
> by this auto-registration scheme? Is checking the FieldType member of this
> structure good and sufficient to protect the calling code from the above
> mentioned mishap?

Joris, 

I believe you would call the _TIFFFindFieldInfo() function:

  const TIFFFieldInfo*
  _TIFFFindFieldInfo(TIFF* tif, ttag_t tag, TIFFDataType dt)

The data type can be TIFF_ANY to find any tag definition matching
tag code "tag".   The TIFFFieldInfo looks like this:

typedef	struct {
	ttag_t	field_tag;		/* field's tag */
	short	field_readcount;	/* read count/TIFF_VARIABLE/TIFF_SPP */
	short	field_writecount;	/* write count/TIFF_VARIABLE */
	TIFFDataType field_type;	/* type of associated data */
        unsigned short field_bit;	/* bit in fieldsset bit vector */
	unsigned char field_oktochange;	/* if true, can change while writing */
	unsigned char field_passcount;	/* if true, pass dir count on set */
	char	*field_name;		/* ASCII name */
} TIFFFieldInfo;

I'm not sure why the function is prefixed with an underscore.  I would assume
that means it isn't intended for external use, but I'm not sure why. 
As you note,
in the auto-registration situation application need a way of finding out how the
tag has been defined in order to operate it without apriori knowledge. 

I suspect we should promote TIFFFindFieldInfo to a properly supported (ie
documented) externally visible function. 

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