Thread

Posted on Tue Jul 8 14:32:21 2008 by justin
Nikon NEF file DateTimeOriginal Write Error
I have been performing some tests on NEF files from my Nikon D50 and D200 cameras. I am trying to set the -EXIF:datetimeoriginal tag. I have noticed that once I have written to the tag, I can then not re-write to it again, I get the error "Error: Bad format (0) for SubIFD entry 0". If I restore the file from it's backup nef_original file I can perform the operation again with the same result. Please find example below:
C:\nefs>exiftool -EXIF:datetimeoriginal c:\nefs\DSC_0504.nef Date/Time Original : 2008:06:12 11:09:13 C:\nefs>exiftool -EXIF:datetimeoriginal="2004:05:18 19:17:22" c:\nefs\DSC_0504.nef 1 image files updated C:\nefs>exiftool -EXIF:datetimeoriginal c:\nefs\DSC_0504.nef Date/Time Original : 2004:05:18 19:17:22 C:\nefs>exiftool -EXIF:datetimeoriginal="2005:12:38 11:57:22" c:\nefs\DSC_0504.nef Error: Bad format (0) for SubIFD entry 0 - c:\nefs\DSC_0504.nef 0 image files updated 1 files weren't updated due to errors
I'm using Exiftool v7.35 command line. Is it a one shot deal to write to this tag and is there any chance the resultant .nef file contains corruption as it can not be re-written to?
Direct Responses: 8239 | Write a response
Posted on Tue Jul 8 15:45:24 2008 by exiftool in response to 8238
Re: Nikon NEF file DateTimeOriginal Write Error
Thanks for reporting this! This is a bug that was introduced in exiftool 7.33. The rewritten NEF images are fine, but exiftool 7.33-7.35 erroneously report an error when reading the SubIFD. I will fix this and get out a new release ASAP.

- Phil
Direct Responses: 8240 | Write a response
Posted on Tue Jul 8 18:07:43 2008 by exiftool in response to 8239
Re: Nikon NEF file DateTimeOriginal Write Error
I have released the Perl and OS X versions of ExifTool 7.36, which fixes this problem. And I will release the Windows version later today when I get access to my Windows machine.

Thanks again for the bug report.

- Phil
Direct Responses: 8241 | Write a response
Posted on Tue Jul 8 19:16:08 2008 by frereroy in response to 8240
Re: Nikon NEF file DateTimeOriginal Write Error
Mac OS X Package: ExifTool-7.36.dmg gives a file not found error. Best wishes.
Direct Responses: 8242 | Write a response
Posted on Tue Jul 8 20:31:16 2008 by exiftool in response to 8241
Re: Nikon NEF file DateTimeOriginal Write Error
Ooops, thanks. Forgot to upload that file.

Done now.

- Phil
Direct Responses: 8251 | Write a response
Posted on Wed Jul 9 20:23:43 2008 by justin in response to 8242
Re: Nikon NEF file DateTimeOriginal Write Error
Thanks Phil, that's great! I've tested the new build and it appears to work. I say appears because I have now noticed the following behavour: Notice that when I try to change the IFD0:DateTimeOriginal tag by 8 hours, it also changes the ExifIFD tag by the same amount. This may of course be by design but my goal is to synchronise all my date tags on a large quantity of .NEF files. This is the classic situation where I forgot to change the time on the camera and being a stickler, I would like to manually change all the meta dates to reflect the local time.
D:\Photos\Library\2006\09\03>exiftool -EXIFIFD:allDates -IFD0:alldates *.nef -s -G1 ======== 2006-09-03 D50-San Francisco-156.NEF [ExifIFD] DateTimeOriginal : 2006:09:03 13:06:56 [ExifIFD] CreateDate : 2006:09:03 13:06:56 [IFD0] DateTimeOriginal : 2006:09:03 21:06:56 [IFD0] ModifyDate : 2006:09:03 13:06:56 D:\Photos\Library\2006\09\03>exiftool -IFD0:DateTimeOriginal-=8 *.nef -s -G1 11 image files updated D:\Photos\Library\2006\09\03>exiftool -EXIFIFD:allDates -IFD0:alldates *.nef -s -G1 ======== 2006-09-03 D50-San Francisco-156.NEF [ExifIFD] DateTimeOriginal : 2006:09:03 05:06:56 [ExifIFD] CreateDate : 2006:09:03 13:06:56 [IFD0] DateTimeOriginal : 2006:09:03 13:06:56 [IFD0] ModifyDate : 2006:09:03 13:06:56
In addition to the above I would be grateful for any informed comment on the following: I noticed some junk data in the xmp area in many of my images, placed by adobe photoshop elements 4. As I intend to move forward with adobe lightroom, I'm considering using exiftool to remove the unwanted xmp data so I can start afresh. It is my understaning that files straight off the camera do not contain xmp data anyway? Any observations/pitfalls would be greatly appreciated. Many thanks Phil for your patience and congratulations on an excellent application! Justin
Direct Responses: 8252 | Write a response
Posted on Wed Jul 9 20:47:54 2008 by exiftool in response to 8251
Re: Nikon NEF file DateTimeOriginal Write Error
Hi Justin,

There is an ambiguity between information in IFD0 and the ExifIFD. The tags should exist in one or the other, but not both. Occasionally software writes a tag to the wrong IFD, or writes it to both when it shouldn't. To account for this, exiftool attempts to maintain consistency between tags in IFD0 and ExifIFD, and both tags will get updated when you write to either.

You are right that to my knowledge no current camera generates XMP, but it is only a matter of time...

I haven't seen this junk data that you are talking about, so I can't comment on it.

- Phil
Direct Responses: 8253 | Write a response
Posted on Wed Jul 9 20:54:10 2008 by exiftool in response to 8252
Re: Nikon NEF file DateTimeOriginal Write Error
I just looked at your last post in more detail and noticed the IFD0/ExifIFD inconsistency. By the specification, DateTimeOriginal should be written to the ExifIFD, not IFD0. However, it seems that the IFD0 value is correct. To fix this, you could move IFD0:DateTimeOriginal to the properl location:

exiftool "-Exif:DateTimeOriginal<IFD0:DateTimeOriginal" FILE

This will write the proper value to the proper location (ExifIFD in this case), and remove the value from the improper location (IFD0).

- Phil
Direct Responses: 8270 | Write a response
Posted on Fri Jul 11 14:11:18 2008 by justin in response to 8253
Re: Nikon NEF file DateTimeOriginal Write Error

Hi Phil, Many thanks for your help. That worked a treat!

I should have explained that the 'junk' I mentioned was partly old keywords I had added with Adobe Photoshop Elements 4 and partly meta that the aforementioned application wrote to the files without my knowledge.

My goal is to tidy up 14000 images to be "as shot" so I can import them clean into Lightroom.I have found keywords writen into Exif, IPTC and XMP and I would prefer to null the IPTC and XMP and ensure the exif data is as I would like prior to Lightroom indexing the images. Does this seem sensible?

Direct Responses: 8271 | Write a response
Posted on Fri Jul 11 14:19:49 2008 by exiftool in response to 8270
Re: Nikon NEF file DateTimeOriginal Write Error
Sounds reasonable to me if the IPTC and XMP doesn't contain useful information. You wouldn't want to import a lot of junk into your lightroom database.
Write a response