how do you change the Mac Finder Created date to reflect EXIF Date/Time Original

Started by tomlesser, January 17, 2012, 04:42:50 PM

Previous topic - Next topic

tomlesser

Hi All:

Wow, am I ever in over my head here!  I hope there's a simple answer to my problem.

I'm using a Mac, OS X 10.6.8.

I shoot photos in DNG format, and tweak them in Adobe Camera Raw.  I output them as JPGs through Photoshop/Bridge.  The DNGs record "the moment the shutter was pushed" date and time in the EXIF data.  The derivative JPGs retain that Date and Time info in the EXIF data ... it is visible as both Date/Time Original and Create Date in the Terminal window when I drop a JPG there with ExifTool running.  All of that is good.

When I view the JPGs in the Mac Finder, the Create date is not "the moment the shutter was pushed" ... it is the Date/Time when the JPG was processed out from the DNG.  That is not good.

Will ExifTool process a folder full of JPGs to change the Create date shown in the Finder so that it reflects the Date/Time of "the moment the shutter was pushed" instead of the Date/Time that the JPG was processed?

If so, can someone kindly provide the text and any additional instructions that will affect this change?

FWIW, this is important to me because an image viewer/sharing application that I would like to use displays the JPG processing date/time instead of the Date/Time of "the moment the shutter was pushed" and that is very misleading in this particular application ... it makes it look as though the photos were made at a date and time later than their actual capture.

Thank you to any and all who can help.

Tom



Phil Harvey

Hi Tom,

When you select File/Get Info in the Finder menus, you see "Created" and a "Modified" date/times for a file.  ExifTool can be used to set the "Modified" date/time, but unfortunately (due to OS differences) can not currently set the "Created" date/time.  In case setting the "Modified" date is useful to you, it can be done like this from the metadata in a file:

exiftool "-filemodifydate<datetimeoriginal" FILE

where FILE is any number of files or folders (dropped onto the Terminal window).  This command will work provided that the source file is readable by ExifTool and contains DateTimeOriginal information.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

tomlesser

Well, Phil, I was afraid "it can't be done" would be your response, but thank you.

FYI, something that I did not expect to happen, based on your response, did happen.  Using the command line you provided, I dropped 76 images on Terminal.  Some were taken on 12-27-11, the rest on 12-28-11.  They were all processed through Bridge in the evening on 12-28-11. 

Before ExifTool, the Created and Modified date for all the images (both 12-27-11 and 12-28-11 captures) read 12-28-11  ... the date they were processed through Bridge.

After ExifTool, (and this is what I did not expect), both the Create and Modify dates for the 12-27-11 captures did  change from 12-28-11 to 12-27-11 ... the correct date (and time). These corrected dates displayed both in the Finder and in the Get Info window  :)

I uploaded a few of the ExifTool-tweaked images to see whether they would display properly in the photo-sharing app I mentioned, but it displayed the 12-27-11 images with the date as 12-28-11  :(

So I went back to ExifTool and dropped one of the 12-27-11 images in Terminal, and then searched for 2011:12:28 to see where that date was still being stored.  I found it in 3 locations: in Modify Date, Metadata Date and History When.

I suspect these results are not news to you, but thought I'd report them in case they shed any light on anything.

Thanks for your help.
Tom



Phil Harvey

Hi Tom,

I don't understand why the filesystem creation date was changed.  I did some tests myself and don't remember this being the case.

You can use ExifTool to change any of the metadata in the file so that your photo-sharing app shows the correct date.  See FAQ number 24 about how filesystem timestamps are effected by changing metadata in the file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

JanK

Hey Tom, hey Phil!

@Phil
Why did you not understand the change of the file Creation Date? That is exactly the same over which we have talked. OSX set the CreationDate because otherwise it will conflict with the ModifyDate. It is not normal to have a Modification Date before a Creation Date. That can't be right. First you have to built something and then you can modify it.

@Tom
Reading from here. There is a workaround for Mac User.
https://exiftool.org/forum/index.php/topic,3167.msg16741.html#msg16741

In a short way:

  • You capture a picture on 2010:12:01
  • You did something that file needs be rewritten. (Using Exiftool in some way or copying the file from a CD. With that the FileModifyDate has changed. And the CreateDate to. Both will be the date/time of the moment where you change the picture. For Example both is set to 2012:01:18
  • When you set exiftool "-filemodifydate<datetimeoriginal" FILE you generate a Modify Date (2010:12:01) that will be before the Creation Date (2012:01:18). OSX said "this can't be right" and correct the Creation Date as well. In this case to the Modify Date so it is (2010:12:01).

Thanks to OSX.

Edit: Fixed example dates
-Mac OSX Mountain Lion-

Phil Harvey

Quote from: JanK on January 18, 2012, 12:18:16 PM
@Phil
Why did you not understand the change of the file Creation Date? That is exactly the same over which we have talked. OSX set the CreationDate because otherwise it will conflict with the ModifyDate.

Right!  Doh.  Thanks for reminding me.  The behaviour is different if you try to set the modification date prior to the creation date.  In this case, the creation date is changed, and as JanK points out this "feature" may be used to indirectly set the filesystem creation date in OS X.

I had forgotten about this.

- Phil

Edit: I have now documented this behaviour in the Extra tags documentation.  The good thing about having a bad memory is that it forces me to document things properly. :)
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

tomlesser

Hi All:

I've been distracted for a couple of days, but am still trying to resolve this issue.  Thank you, Phil, for the commands you provided; and JanK for the references you provided.  Reading them was enlightening, but I'm still in over my head.

This command line provided by Phil:      exiftool "-filemodifydate<datetimeoriginal" FILE    successfully changed the Created and Modified dates that are reported in the Mac Finder and Get Info panel, but when I uploaded the image to the photo-sharing site, it still displayed the wrong date, i.e. it displayed the date the JPG was processed out from the DNG, not the date the photo was taken.

So, using the command exiftool -time:all -a -G0:1 -s found in Phil's FAQ #24 to extract dates, I ran the image and discovered the "processed date" of 2011:12:28 20:32:46 still appears in 4 separate locations, shown in Bold type below.

[File:System]   FileModifyDate                  : 2011:12:27 11:01:53-05:00
[EXIF:IFD0]     ModifyDate                      : 2011:12:28 20:32:46
[EXIF:ExifIFD]  DateTimeOriginal                : 2011:12:27 11:01:53
[EXIF:ExifIFD]  CreateDate                      : 2011:12:27 11:01:53
[IPTC]          DateCreated                     : 2011:12:27
[IPTC]          TimeCreated                     : 11:01:53
[XMP:XMP-xmp]   ModifyDate                      : 2011:12:28 20:32:46-05:00
[XMP:XMP-xmp]   CreateDate                      : 2011:12:27 11:01:53-05:00
[XMP:XMP-xmp]   MetadataDate                    : 2011:12:28 20:32:46-05:00
[XMP:XMP-photoshop] DateCreated                 : 2011:12:27 11:01:53
[XMP:XMP-xmpMM] HistoryWhen                     : 2011:12:28 20:32:46-05:00, 2011:12:28 20:32:46-05:00
[ICC_Profile:ICC-header] ProfileDateTime        : 1998:02:09 06:49:00
[Composite]     DateTimeCreated                 : 2011:12:27 11:01:53

Can these fields also be changed to reflect the "moment the shutter was pushed" date/time, i.e.  2011:12:27 11:01:53   ????

If so, is there a command line that will make that change?  And more to the point  :), what is it?

Thank you, all.
Tom




Phil Harvey

Hi Tom,

You can copy information between any 2 tags using the same command as before.  Here is a command to change filemodifydate plus all of the other tags in bold:

exiftool "-filemodifydate<datetimeoriginal" "-modifydate<datetimeoriginal" "-metadatadate<datetimeoriginal" "-historywhen<datetimeoriginal" FILE

But I am surprised that the photo sharing site uses any of the above date/time values.  It should use either DateTimeOriginal or CreateDate from the EXIF or XMP.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

JanK

Tom please contact the website to check what date time they use. It would be interesting for me and a help for the website if they use a wrong date time.

And please note:
exiftool "-filemodifydate<datetimeoriginal" FILE
will not change the create date. This was done indirectly by OSX in the fact that the filemodifydate is before the createdate.
-Mac OSX Mountain Lion-

tomlesser

Phil  .... Thank you!!  This is wonderful!  I just uploaded a photo after using your last recommendations and all is well!!  I couldn't be more pleased  :)

Browsing the exiftool Application category the other day I came across instructions to make (I think it was called ....) a "drop-app."  I'll try that next, and if successful will make its use a part of my routine image processing workflow.

And to JanK .... yesterday I got a "working on it" note from the developer of the photo-sharing site (it's a niche product designed specifically for building construction documentation photos).... he'd been without power for some time due to recent nasty winter weather in the Pacific Northwest.  "Which field" was just one of my questions.  I'll let you know when I hear back from him.

Thanks again!
Tom

Phil Harvey

Hi Tom,

I'm glad this worked.  It will be interesting to hear if you find out what date/time was being used.

The drag-n-drop app is an easy thing to do in Windows, but is much more difficult on a Mac.  On a Mac, you need to do some scripting with AppleScript or create an Automator action to do this.  There are some examples available from the ExifTool home page.  In Windows this is easier because the GUI is based on command-line apps, unlike the Mac.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

tomlesser

Hi Phil:

Yesterday when I tried out the new command lines you posted
Quoteexiftool "-filemodifydate<datetimeoriginal" "-modifydate<datetimeoriginal" "-metadatadate<datetimeoriginal" "-historywhen<datetimeoriginal" FILE
I was only dropping one file at a time into Terminal, and all went well.  Later, I dragged a folder to Terminal, and got something unexpected.  Instead of simply changing the metadata, duplicate copies of every file (with "corrected" dates) were created; the folder then contained all of the original files, and a copy of each, named "filename_original."

FWIW, I selected 2 files in Bridge before I dropped them from a Finder window into Terminal.  After the script had run and the duplicate files had been created, the 2 files I selected in Bridge still showed as "selected" and the new files, which did not show as "selected," were the ones appended with "_original."

Way back at the beginning of this thread, you provided this more-simple command
Quoteexiftool "-filemodifydate<datetimeoriginal" FILE
and it processed folders without creating the duplicates.  Any idea why the new "multi-command" creates the dupes, and how to change it so it doesn't?

Thanks again
Tom

Phil Harvey

Hi Tom,

When ExifTool changes any data in the file, an "_original" backup is automatically generated.  This is a safety feature.  To disable this feature, add -overwrite_original to the command line.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


idic314

I think it was fate that I found this thread.  I registered to say thanks for having this discussion.  I was seeking the same thing, and my name is Tom.  So thanks for hashing it out!