2011.03.28 19:32 "Re: [Tiff] TIFFReadCustomDirectory and TIFFWriteCustomDirectory", by Andreas Kleinert
when writing a new directory, TIFFWriteCustomDirectory() puts it to the end of the file. Furthermore, the offset return value (in &offset) seems to be equivalent to tif->tif_nextdiroff - as the new directory is the last one in the file, zero IMHO makes perfect sense?!
I just wonder if the API intentionally was designed this way, or whether it's a bug. However, when just following this logic then TIFFCurrentDirOffset() should return what you expect.
Is there any error output?
I have started using TIFFReadCustomDirectory to access some special IFD blocks in TIFF-FX files. That seems to be working OK, but I can't find a way to do the opposite, and write similar special IFD blocks. I found TIFFWriteCustomDirectory, but it doesn't seem to be documented, and doesn't seem to be a corollary of TIFFReadCustomDirectory. When I try calling TIFFWriteCustomDirectory(tiff_file, &offset); it always returns zero for the offset, and I can't seem to find a related block of tags in the resulting file, if I do a hex dump of that file. Can anyone help?