Thread

Posted on Sun Feb 17 21:31:29 2008 by iamjwk1
Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?
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

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 : -
Direct Responses: 7123 | Write a response
Posted on Mon Feb 18 15:45:06 2008 by exiftool in response to 7118
Re: Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?
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
Direct Responses: 7125 | Write a response
Posted on Mon Feb 18 19:18:26 2008 by iamjwk1 in response to 7123
Re: Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?
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
Direct Responses: 7127 | Write a response
Posted on Mon Feb 18 23:46:23 2008 by exiftool in response to 7125
Re: Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?
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
Direct Responses: 7130 | Write a response
Posted on Tue Feb 19 07:52:06 2008 by iamjwk1 in response to 7127
Re: Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?
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
Direct Responses: 7133 | Write a response
Posted on Tue Feb 19 15:37:42 2008 by exiftool in response to 7130
Re: Problem: IFD0:DateTimeOriginal cannot coexist with ExifIfd:DateTimeOriginal?
exiftool -exifIFD:datetimeoriginal="2007:02:18 09:07:22" -ifd0:datetimeoriginal="2007:02:18 09:07:22" image.jpg
Write a response