| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2008.09.23 16:57 "Re: New to list, with a query on TIFFTAG_GDAL_METADATA", by Frank WarmerdamDavid 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
|
|||||||