2009.04.16 09:42 "[Tiff] wrinting to TIFF_UNDEFINED", by Jachym Cepicky

2009.04.16 09:42 "[Tiff] wrinting to TIFF_UNDEFINED", by Jachym Cepicky


I would like to create custom tiff tag of type TIFF_UNDEFINED. I have modified libtiff/tif_dirinfo.c, so it contains


    FIELD_CUSTOM, 0,    1,  "Signature" },

in the static const TIFFFieldInfo tiffFieldInfo[] structure. SOILTEQTIFFTAG_SIGNATURE is macro for 65001.

According to documentation to some kind of proprietary program, the tag should contain MD5 sum of some file or 0.

When I try to read the data from reference file, which contains the tag, via tiffinfo, I get following result:

$ tiffinfo DS9204.TIF|grep Signature

Signature: 0x3c,0x7e,0x3c,0xb0,0xb1,0xfb,0x74,0x35,0x3b,0xf0,0x80,0xd1,0x76,0x5b,0x96,0xdb

which is at least something and if I let it print (I'm more familiar with python than with C)

>>> print 16*"%x" %\

>>> (0x3c,0x7e,0x3c,0xb0,0xb1,0xfb,0x74,0x35,0x3b,0xf0,0x80,0xd1,0x76,0x5b,0x96,0xdb)

I get


which looks like md5sum

I guess, some modifications in tif_print.c have to be done. But this is not the problem.

The problem is, how to set the Signature tag on a new fresh created file. No matter, if I try

tiffset -s Signature 0
tiffset -s Signature 0x00

tiffset -s 65001 0
tiffset -s 65001 0x00

when I call tiffinfo afterwards, I get no response on this tag.

I tried to set other tags with TIFF_UNDEFINED type, which I found in tif_dirinfo.c, but none seems to be working.

How to define writeable TIFF_UNDEFINED the correct way?



Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/JachymCepicky.pgp
Key fingerprint: 0C6D 0EAE 76BD 506C F299 ED8A C8AB 74B8 08D4 E08F