2006.01.28 16:55 "Re: [Tiff] Dead directories after TIFFRewriteDirectory()", by Roland Richter
Or, is there a way to "defrag" the TIFF file, i.e. get rid of those dead directories?
Copying the file with tiffcp will get rid of the dead directories, but it will also lose custom tags. You might want to build your own "copier" to defrag the files, if this is important enough to you.
In the meantime, I wrote my own copy/defrag routine (with a peek on tiffcp/tiffsplit sources). It's far from complete, but it passes all my tests, so that will suffice for now.
> It might also
be that there are copying programs that will carry along all existing tags (custom or otherwise) but libtiff is not very handy for this.
You are right.
The more I work with TIFF, the more I get the impression that its original designers not only had a image file format in mind, but rather some sort of complete file system (as the name "directory" already indicates.) Unfortunately, they did not provide the corresponding "file system API"...