Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?

Started by Archive, May 12, 2010, 08:54:15 AM

Previous topic - Next topic

Archive

[Originally posted by iamjwk1 on 2008-02-17 19:31:29-08]

I am having problems with exiftool v7.17 (windows command line version). Trying to fix wrong date/time in the metadata, but see strange things happening. I concluded that there can only be either "IFD0:DateTimeOriginal" or "ExifIFD:Date/Time Original", while both exists in the original file (and are always available in Nikon NEF files).

I played around with a test file and created the output below:

1. list the dates in the "original" file

2. copy IFD0:DateTimeOriginal to ExifIfd:DateTimeOriginal

3. list the dates in the "modifed" file: IFD0:DateTimeOriginal is deleted (not what I expected/wanted)

4. Copy date manual to IFD0:DateTimeOriginal

5. List the dates in the file again: now ExifIfd:DateTimeOriginal is deleted (again not what I expected)

Am I doing something wrong or is there a bug in exiftool?

Jan-Willem

Code:
Dates in original file
======================
[File]          File Name                       : D200-8790.NEF
[IFD0]          Modify Date                     : 2007:07:29 10:52:01
[ExifIFD]       Create Date                     : 2007:07:29 10:52:01
[ExifIFD]       Date/Time Original              : 2007:07:29 02:00:00
[IFD0]          Date/Time Original              : 2007:07:29 10:52:01
[]              Time Zone Offset                : -
==> ExifIFD:Date/Time Original  should be the same as the other dates

Repair ExifIFD:Date/Time Original
=================================

Perform exiftool command
------------------------
exiftool "-ExifIfd:DateTimeOriginal<IFD0:DateTimeOriginal" -v5 "D200-8790.NEF"

Setting new values from D200-8790.NEF
Writing ExifIFD:DateTimeOriginal
Rewriting D200-8790.NEF...
  Editing tags in: ExifIFD IFD0 TIFF
  Creating tags in: ExifIFD IFD0 TIFF
  FileType = NEF
  MIMEType = image/x-raw
  ExifByteOrder = MM
  Rewriting IFD0
  Rewriting SubIFD
  Rewriting SubIFD1
  Rewriting ExifIFD
    - ExifIFD:DateTimeOriginal = '2007:07:29 02:00:00'
    + ExifIFD:DateTimeOriginal = '2007:07:29 10:52:01'
  Rewriting MakerNotes
  Rewriting NikonPreview
  Rewriting GPS
    - IFD0:DateTimeOriginal = '2007:07:29 10:52:01'
  Copying 1 image data blocks
    1 image files updated

Result
------
[File]          File Name                       : D200-8790.NEF
[IFD0]          Modify Date                     : 2007:07:29 10:52:01
[ExifIFD]       Create Date                     : 2007:07:29 10:52:01
[ExifIFD]       Date/Time Original              : 2007:07:29 10:52:01
[]              Date Time Original              : -
[]              Time Zone Offset                : -

Set IFD0:DateTimeOriginal
=========================

Perform exiftool command
------------------------
exiftool "-IFD0:DateTimeOriginal = '2007:07:29 10:52:01'" -v5 "D200-8790.NEF"

Writing IFD0:DateTimeOriginal
Rewriting D200-8790.NEF...
  Editing tags in: IFD0 TIFF
  Creating tags in: IFD0 TIFF
  FileType = NEF
  MIMEType = image/x-raw
  ExifByteOrder = MM
  Rewriting IFD0
  Rewriting SubIFD
  Rewriting SubIFD1
  Rewriting ExifIFD
    - ExifIFD:DateTimeOriginal = '2007:07:29 10:52:01'
  Rewriting MakerNotes
  Rewriting NikonPreview
  Rewriting GPS
    + IFD0:DateTimeOriginal = '2007:07:29 10:52:01'
  Copying 1 image data blocks
    1 image files updated

Result
------
[File]          File Name                       : D200-8790.NEF
[IFD0]          Modify Date                     : 2007:07:29 10:52:01
[ExifIFD]       Create Date                     : 2007:07:29 10:52:01
[]              Date Time Original              : -
[IFD0]          Date/Time Original              : 2007:07:29 10:52:01
[]              Time Zone Offset                : -

Archive

[Originally posted by exiftool on 2008-02-18 13:45:06-08]

This is by design.  Tags should not be duplicated between IFD0 and
the ExifIFD, so ExifTool takes care of this by deleting the tag in the
other directory when you write it.  If you really want the value in
both directories, you must write both of them at the same time.
In general, it is best to just specify EXIF instead of IFD0 or ExifIFD
when writing because then ExifTool will put it in the proper
directory according to the EXIF specification (although I have
seen tags often enough in the wrong directory -- this is part
of the reason for the logic to delete them from the wrong
directory when writing).

- Phil

Archive

[Originally posted by iamjwk1 on 2008-02-18 17:18:26-08]

Still a little bit struggling with it; check new Nikon NEF files which have not been tampered by software; they all have DateTimeOriginal in IFD0 and ExifIFD.

So if I follow your advice all programs will find the DateTimeOrigal? Or is there a reason IFD0 is used?

Jan-Willem

Archive

[Originally posted by exiftool on 2008-02-18 21:46:23-08]

I don't know the reason that Nikon duplicates DateTimeOriginal
in IFD0, but if any software is going to have a problem with
this being missing it will be the Nikon software.  Most other
software would expect DateTimeOriginal in the ExifIFD.  But
if you are really worried, you can always write it to both
locations simultaneously as I mentioned.

- Phil

Archive

[Originally posted by iamjwk1 on 2008-02-19 05:52:06-08]

Phil,

I will see how Nikon Capture NX reacts on it. You mention writing both values at the same time; how do I do this via the commandline exiftool?

Jan-Willem

Archive

[Originally posted by exiftool on 2008-02-19 13:37:42-08]

exiftool -exifIFD:datetimeoriginal="2007:02:18 09:07:22" -ifd0:datetimeoriginal="2007:02:18 09:07:22" image.jpg

Archive

[Originally posted by fogcity on 2009-08-25 18:05:53-07]

I found this thread after running into problems using Aperture to modify EXIF dates of Nikon RAW (NEF) files.  When Aperture modifies DateTimeOriginal, it does not update the IFD0 copy. This leaves a mess -- some applications get the unmodified (incorrect) date out of IFD0, while Aperture and others read it from ExifIfd:DateTimeOriginal.

I now have 1000+ photos with this problem!

While the simple example given in the previous entry in this thread is encouraging, I'm clueless with command-line interfaces. Can anyone suggest a command that would "take all files in the current directory, and copy exifIFD:datetimeoriginal to ifd0:datetimeoriginal in each"?