2004.07.26 10:07 "[Tiff] Is this possible by using LibTiff?", by Sachin Garg

2004.07.29 16:21 "Re: [Tiff] Is this possible by using LibTiff?", by Andrey Kiselev

Its actually coming from another Tiff file... what I am planning to do is to read in a tiff directory (using libtiff), and then write it out to another tiff, this way, I can again read in that second tiff (again using libtiff) to getback the same directory with all the same tagvalues.

It is still don't clear for me why do you need to store the directory. You can read the tags from input image one by one and write them out afterwards. There is one pitfall here: libtiff can "understand" the subset of the "well known" TIFF tags only (i.e., the ones defined in the TIFF specs and several other widely used tags). The library can't interpret arbitrary proprietary tags, but you can read them anyway using custom tags technique. Consult with the tiffinfo (actually tif_print.c module) and tiffdump sources to find the approaches to read custom TIFF tags.

If you still want to write the directory contents somwhere you should use TIFFCheckpointDirectory() function after filling the tag values. It flashes directory out, but you should be very carefull with the strip offsets and sizes. It wil be better to use the single strip in this case.


Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517