
Thread
2003.07.31 12:48 "[Tiff] RE: Tiff digest, Vol 1 #5 - 1 msg", by Tiglao, Percy
Andrey,
Thank you very much for the sample code. Do you have any other suggestions on how to handle private tag of type "UNDEFINED" without modifying libtiff. Type "ASCII" does not work well for my private field since my complex structure contains, among other type, several null terminated array of characters (strings). Reading of the field stops as soon as the first null is encountered.
Regards,
Percy Tiglao
--__--__--
Message: 1
Subject: Re: [Tiff] extended tags
On Mon, Jul 28, 2003 at 04:29:07PM -0700, Tiglao, Percy wrote:
I am new to libtiff and I have been trying to use Niles' contrib/tags code to no avail. Does anyone have a sample code that I could use as a reference that adds a private tag of type "TIFF_UNDEFINED" to support a complex data structure in a single private field?
Following code valid for the libtiff 3.6.0 (from CVS or beta release):
#include <tiffio.h>
#define TIFFTAG_MYTAG 666
int main()
{
TIFF *tiff;static const TIFFFieldInfo xtiffFieldInfo[] = {
{ TIFFTAG_MYTAG, -1,-1, TIFF_ASCII, FIELD_CUSTOM,
1, 0, "MyTag" }
};tiff = TIFFOpen("test.tiff", "r+");
TIFFMergeFieldInfo(tiff, xtiffFieldInfo,
sizeof(xtiffFieldInfo) / sizeof(xtiffFieldInfo[0]));TIFFSetField(tiff, TIFFTAG_MYTAG, "Tag contents"); TIFFRewriteDirectory(tiff);
TIFFClose(tiff);
}
--__--__--
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org http://remotesensing.org/mailman/listinfo/tiff