Bug #864

Mapping of Exif DateTime fields to XMP changed in spec

Added by Marcel Wiesweg about 5 years ago. Updated over 2 years ago.

Status:ClosedStart date:30 Oct 2012
Priority:NormalDue date:
Assignee:Alan Pater% Done:

100%

Category:metadata
Target version:0.25

Description

In contrast to an older version of the XMP specification, the mapping of these two Exif field to their XMP counterparts, as defined in converter.cpp, is in the latest XMP specification, the MWG guidance 2.0, and Exif 2.3 for XMP as follows:

Exif.Image.DateTime -> xmp:ModifyDate and probably tiff:DateTime ()
Exif.Photo.DateTimeOriginal -> photoshop:DateCreated and exif:DateTimeOriginal (
*)
Exif.Photo.DateTimeDigitized -> xmp:CreateDate

() Interestingly, tiff:DateTime disappeared from Exif 2.3 for XMP. Looks like a mistake in the spec.
(
*) MWG guidance and Exif 2.3 contradict

864.MWG.simple.diff Magnifier - Clean patch on trunk (9.65 KB) Alan Pater, 21 Apr 2015 12:55


Related issues

Related to Exiv2 - Feature #1050: Extend exif <> iptc <> xmp conversions Assigned 04 Apr 2015
Related to Exiv2 - Bug #1112: lost timezone information in XMP dates Closed 28 Aug 2015

Associated revisions

Revision 3665
Added by Alan Pater over 2 years ago

#864 Reverse DateTime mappings from r3659 that fail conversion testcase 14

Revision 3712
Added by Alan Pater over 2 years ago

#864 Update DateTime conversions to current spec

Revision 3750
Added by Niels Kristian Bech Jensen over 2 years ago

#864: Update bugfixes-test.out to match r3712.

History

#1 Updated by Marcel Wiesweg about 5 years ago

(second part again, formatting was screwed up by stars)

Exif.Image.DateTime -> xmp:ModifyDate and probably tiff:DateTime (1)
Exif.Photo.DateTimeOriginal -> photoshop:DateCreated and exif:DateTimeOriginal (2)
Exif.Photo.DateTimeDigitized -> xmp:CreateDate

(1) Interestingly, tiff:DateTime disappeared from Exif 2.3 for XMP. Looks like a mistake in the spec.
(2) MWG guidance and Exif 2.3 contradict

#2 Updated by Alan Pater over 2 years ago

  • Category set to metadata
  • Status changed from New to Assigned
  • Assignee set to Alan Pater
  • Target version set to 0.25
  • % Done changed from 0 to 100

#3 Updated by Alan Pater over 2 years ago

  • % Done changed from 100 to 50

r3659 made these changes, but the test suite conversions.sh does not like them. I am re-evaluating the changes.

#4 Updated by Alan Pater over 2 years ago

The test suite sets different values for Exif.Photo.DateTimeOriginal and Iptc.Application2.DateCreated but MWG guidelines map these together. The DateTime test cases will need changing as well.

Follows are the various Date/Time fields that should be mapped together, according to the MWG.

Original Date/Time – Creation date of the intellectual content.

    Exif.Photo.DateTimeOriginal / Exif.Photo.SubSecTimeOriginal
    Iptc.Application2.DateCreated / Iptc.Application2.TimeCreated 
    Xmp.photoshop.DateCreated

Digitized Date/Time – Creation date of the digital representation.

    Exif.Photo.DateTimeDigitized &/ Exif.Photo.SubSecTimeDigitized
    Iptc.Application2.DigitizationDate / Iptc.Application2.DigitizationTime 
    Xmp.xmp.CreateDate

Modification Date/Time – Modification date of the digital image file.

    Exif.Image.DateTime / Exif.Photo.SubSecTime 
    Xmp.xmp.ModifyDate

Regarding the modify date, that is only if the image itself is modified. If only the metadata is modified, we have the following field, although without MWG guidance: Metadata Date/Time – Modification date of the metadata

    Xmp.xmp.MetadataDate

I think the MWG guidelines should take precedence over the xmp.tiff mappings, where MWG guidance exists. MWG guidelines are what all the different parties agree to when working together. The other guidelines are what each individual group does in their own house, so to speak.

If there is no disagreement, I will get to work on all this.

#5 Updated by Alan Pater over 2 years ago

  • File iptcConvert.diff added

To perform the IPTC <> XMP conversions I created a couple of new functions: cnvIptcDate and cnvXmpDateToIptc, based on cnvIptcValue and cnvXmpDValueToIptc, respectively.

It works for me, but I need to do further testing before submitting the code. If someone could take a look at the attached patch and see if there are any silly errors, that would be great.

#6 Updated by Alan Pater over 2 years ago

  • % Done changed from 50 to 90

I want to backtrack and make this issue only be about the changes to the XMP mappings, not the IPTC mappings.

This is because my testing shows that converting from IPTC is a lot more complicated then I originally thought, due to IPTC not having anywhere to store subSec times and EXIF not having anywhere to store TimeZone data. And probbly due to some misunderstanding on my part. I'll make the IPTC mappings in Issue #1050.

#7 Updated by Alan Pater over 2 years ago

With that, this is almost complete. One area of confusion remains for me. In test 15 of conversions.sh, the timezone is specified when the XMP sidecar is imported into the image. I am not sure why that is there.

My revised test leaves out the timezone. I should also mention that my test server timezone is set to UTC. Is that important?

~/src/exiv2$ diff trunk/test/conversions.sh work/test/conversions.sh 

205c205
<     TZ=GMT-8 runTest exiv2 -iX v.jpg
---
>     runTest exiv2 -iX v.jpg

#8 Updated by Alan Pater over 2 years ago

  • File 864.simple.diff added

This patch does what I think is the minimum to bring the mapping of DateTime up to spec.

1) It maps the DateTime keys/properties according to MWG guidelines.
2) It modifies test/conversions.sh to be consistent with those mappings.
3) It validates and confirms the resulting differences to test/data/conversions.out

#9 Updated by Alan Pater over 2 years ago

  • File deleted (iptcConvert.diff)

#10 Updated by Alan Pater over 2 years ago

  • File deleted (864.simple.diff)

#11 Updated by Alan Pater over 2 years ago

#12 Updated by Alan Pater over 2 years ago

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

#13 Updated by Andreas Huggel over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux