Feature #668

"TIFF-safe" setExifData variant

Added by Andreas Huggel over 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:03 Jan 2010
Priority:NormalDue date:
Assignee:Andreas Huggel% Done:

100%

Category:design
Target version:0.20

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

Related to Exiv2 - Feature #665: Write support for Olympus RAW ORF files Closed 29 Dec 2009
Related to Exiv2 - Bug #831: For TIFF-like images, non-intrusive writing is not used w... Closed 04 Jul 2012
Related to Exiv2 - Bug #1182: Exiv2 is unable to update any Exif.SubImageN.xxx tag such... Closed 02 May 2016
Related to Exiv2 - Feature #992: Better raw file support and test Assigned 18 Sep 2014
Blocked by Exiv2 - Bug #701: Nikon capture nx won't save a raw file which was metadata... Closed 03 May 2010

Associated revisions

Revision 2037
Added by Andreas Huggel about 7 years ago

#668: In TIFF and TIFF-like images, never modify 'image tags'. This patch implements the basic idea.

Revision 2046
Added by Andreas Huggel about 7 years ago

#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).

Revision 2198
Added by Andreas Huggel about 7 years ago

#668: Fix copying of composite objects. (digiKam bug 235171)

Revision 2212
Added by Andreas Huggel almost 7 years ago

#668: Fixed obscure issue when copying SubIFDs. (digiKam bug 236127)

History

#1 Updated by Andreas Huggel about 7 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.

#2 Updated by Andreas Huggel about 7 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 and TiffEncoder
  • 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

#3 Updated by Andreas Huggel about 7 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.

#4 Updated by Andreas Huggel about 7 years ago

Getting there...

  • eventually the "special purpose code" should be removed from the command line utility

#5 Updated by Andreas Huggel about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Andreas Huggel
  • % Done changed from 0 to 80

#6 Updated by Andreas Huggel almost 7 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 80 to 100

#7 Updated by Andreas Huggel almost 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux