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
September 2008

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

2008.09.23 16:24 "New to list, with a query on TIFFTAG_GDAL_METADATA", by David J Taylor
2008.09.23 16:57 "Re: New to list, with a query on TIFFTAG_GDAL_METADATA", by Frank Warmerdam
2008.09.24 08:18 "Re: New to list, with a query on TIFFTAG_GDAL_METADATA", by David J Taylor
2008.09.24 08:44 "Re: New to list, with a query on TIFFTAG_GDAL_METADATA", by David J Taylor

2008.09.23 16:57 "Re: New to list, with a query on TIFFTAG_GDAL_METADATA", by Frank Warmerdam

David J Taylor wrote:
> Folks,
> 
> I'm new to this list, so please forgive any netiquette errors!
> 
> I have a GeoTIFF application working with FWTools V1.3.7 DLLs, and using 
> Delphi as my language.  I now need to write some GDAL data, so I woudl 
> like to do something like this:
> 
>  TIFFSetField (tif, TIFFTAG_GDAL_METADATA, PChar (txt));
> 
> However, the field is unrecognised, and trying to define a new TIFF 
> field using
> TIFFMergeFieldInfo seems to be complicated and indeed to be deprecated. 
> How should I be doing this?

David,

GDAL uses this code to merge in the TIFFTAG_GDAL_METADATA tag.

static void GTiffTagExtender(TIFF *tif)

{
     static const TIFFFieldInfo xtiffFieldInfo[] = {
         { TIFFTAG_GDAL_METADATA,    -1,-1, TIFF_ASCII,	FIELD_CUSTOM,
           TRUE,	FALSE,	(char*) "GDALMetadata" },
         { TIFFTAG_GDAL_NODATA,	    -1,-1, TIFF_ASCII,	FIELD_CUSTOM,
           TRUE,	FALSE,	(char*) "GDALNoDataValue" },
         { TIFFTAG_RPCCOEFFICIENT,   -1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
           TRUE,	TRUE,	(char*) "RPCCoefficient" }
     };

     if (_ParentExtender)
         (*_ParentExtender)(tif);

     TIFFMergeFieldInfo( tif, xtiffFieldInfo,
		        sizeof(xtiffFieldInfo) / sizeof(xtiffFieldInfo[0]) );
}

I'm not at all sure how this might be accomplished from Delphi Pascal.

Libtiff should automatically prepare a definition for the tag if it
is encountered in an existing file, but I don't know how you would
add such a tag to a new file without defining it.

I'm not aware of a newer cleaner way of doing the same thing.

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