2004.08.28 13:48 "Re: [Tiff] Re: Copy custom TIFF tags", by Joris Van Damme
as I want to copy *all* the tags in a Tiff Image. If libtiff doesnt supports this functionality, I can work on this to add this functionality to it, if someone can guide me on how to approach the problem.
Here are some scenario's for you to consider:
- I suppose your tag copying is part of tiff splitting or concattenating or something. Now suppose the tag you blindly copy turns out to be a page number (http://www.awaresystems.be/imaging/tiff/tifftags/pagenumber.html)
- Even if your tag copying holds on to all pages in their exact order and positioning (but wouldn't be file copying serve that purpose?), things can still go wrong. You could end up copying a tag of datatype Long that your code knows nothing about, but that actually points to a private IFD, similar to the Exif IFD tag (http://www.awaresystems.be/imaging/tiff/tifftags/exififd.html). You'll copy the exact value, next when a reader comes along that reads your new TIFF file and is Exif aware, it is pointed to a location that now no longer contains the private IFD.
Things could be even more confusing, and tags being safe to copy could depend on the circumstances. For instance, after applying a filter to an image, a thumbnail tag would not be safe to copy, but a GeoTIFF geospatial location tag would be.
This is the reason why no such massive tag copying is included in any of the library or tools code, I believe. Tag copying, without inbuilt knowledge of the tags you copy, is a dangerous matter. I've been discussing with Frank that the 'TIFF Tag Reference', http://www.awaresystems.be/imaging/tiff/tifftags.html, if it turns out to lead to a good complete directory supported by the community, could aim to include a) information about the tags being safe to copy in this or that circumstances, and b) could be built to support an XML feed service, allowing users and/or applications to always the latest version of this tag data.
Untill that time, I can't see how you can solve these problems without first duplicating my tiff tag investigation and directory building effort, and next duplicating my continued updating effort as new/more information is found. Wich is duplicate effort, either bound to be private and incomplete, or either be public and decreasing the chances of any tag directory initiative succeeding rapidly as community support gets divided.
Note that this isn't all bad news, since it means that, best case scenario, the data needed by massive tag copyers and the like might be available some time soon.
Joris Van Damme
Download your free TIFF tag viewer for windows here: