Feature #668
"TIFF-safe" setExifData variant
100%
Description
For TIFF and TIFF-like images, there should be an interface which just "does the right thing".
Currently, a fair bit of special purpose code is required to achieve that.
See this discussion for details.
Related issues
Associated revisions
#668: Extended list of TIFF image tags. (It turned out that there are quite a few standard TIFF tags missing from the Exiv2. To be added separately).
#668: Fix copying of composite objects. (digiKam bug 235171)
#668: Fixed obscure issue when copying SubIFDs. (digiKam bug 236127)
History
Updated by Andreas Huggel over 11 years ago
In TIFF and TIFF-like images, some Exif.*.*
tags are required to correctly display the primary image. These image tags contain image data rather than metadata.
When Exiv2 writes metadata, it must not add, modify or delete any image tags.
The Exiv2 write operation is a two step process:
First, it attempts non-intrusive writing, i.e., in-place updating of the image without re-writing the TIFF structure. The existing image is parsed into a TIFF composite tree and updated with the Exif tags from the Exiv2 Image. No tags are added or deleted in this step and modifying of image tags must be avoided.
Second, if non-intrusive writing is not possible, Exiv2 re-writes the TIFF structure. In this step, all image tags from the original image must be copied to the new TIFF structure. The Exif tags from the Exiv2 Image are used to complete the new TIFF structure. They must not be used to add, modify or delete any of the image tags from the original image.
It should still be possible to create TIFF or TIFF-like images from scratch. In this case (intrusive writing without an original image), the image tags set as Exif tags in the Exiv2 Image will be written to the TIFF structure.
Updated by Andreas Huggel over 11 years ago
Required is
- for each TIFF-like image format, a mechanism to determine if a tag is an image tag
- a way to access this mechanism from
TiffParserWorker::encode
andTiffEncoder
- logic in
TiffParserWorker::encode
to copy image tags from the original image to the new TIFF structure in case of intrusive writing - logic in
TiffEncoder::encodeTiffComponent
to avoid adding, modifying and deleting image tags during both, non-intrusive and intrusive writing
Updated by Andreas Huggel over 11 years ago
- logic in
TiffParserWorker::encode
to copy image tags from the original image to the new TIFF structure in case of intrusive writing
That's turning out to be the messy part. Added a TiffCopier
visitor and introducing a clone()
function on TiffComponent
now.
Updated by Andreas Huggel over 11 years ago
Getting there...
- eventually the "special purpose code" should be removed from the command line utility
Updated by Andreas Huggel over 11 years ago
- Status changed from New to Assigned
- Assignee set to Andreas Huggel
- % Done changed from 0 to 80
Updated by Andreas Huggel over 11 years ago
- Status changed from Assigned to Resolved
- % Done changed from 80 to 100
#668: In TIFF and TIFF-like images, never modify 'image tags'. This patch implements the basic idea.