Can't set FileCreateDate from DateTimeOriginal, missing something?

Started by adiseker, September 29, 2022, 09:50:12 PM

Previous topic - Next topic

adiseker

Definite newbie here, I was using exiftool to set the filesystem create date to the DateTimeOriginal value, and it used to work but now it lies to me about what it did. I am obviously missing something, can someone look at the following and tell me what I did wrong?

MacOS Monterey 12.6
Exiftool 12.45
Perl 5.30.3

andrewdi@Gondor source % exiftool -time:all -a -G0:1 -s _MG_7654.JPG
[File:System]   FileModifyDate                  : 2012:11:03 19:19:00-04:00
[File:System]   FileAccessDate                  : 2022:09:29 21:25:57-04:00
[File:System]   FileInodeChangeDate             : 2022:09:29 20:23:37-04:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:03 19:19:00
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:03 19:19:00
[EXIF:ExifIFD]  CreateDate                      : 2012:11:03 19:19:00
[EXIF:ExifIFD]  SubSecTime                      : 93
[EXIF:ExifIFD]  SubSecTimeOriginal              : 93
[EXIF:ExifIFD]  SubSecTimeDigitized             : 93
[Composite]     SubSecCreateDate                : 2012:11:03 19:19:00.93
[Composite]     SubSecDateTimeOriginal          : 2012:11:03 19:19:00.93
[Composite]     SubSecModifyDate                : 2012:11:03 19:19:00.93

andrewdi@Gondor source % exiftool -v "-FileCreateDate<DateTimeOriginal" _MG_7654.JPG
======== _MG_7654.JPG
Setting new values from _MG_7654.JPG
    1 image files updated

andrewdi@Gondor source % exiftool -time:all -a -G0:1 -s _MG_7654.JPG               
[File:System]   FileModifyDate                  : 2012:11:03 19:19:00-04:00
[File:System]   FileAccessDate                  : 2022:09:29 21:34:06-04:00
[File:System]   FileInodeChangeDate             : 2022:09:29 20:23:37-04:00
[EXIF:IFD0]     ModifyDate                      : 2012:11:03 19:19:00
[EXIF:ExifIFD]  DateTimeOriginal                : 2012:11:03 19:19:00
[EXIF:ExifIFD]  CreateDate                      : 2012:11:03 19:19:00
[EXIF:ExifIFD]  SubSecTime                      : 93
[EXIF:ExifIFD]  SubSecTimeOriginal              : 93
[EXIF:ExifIFD]  SubSecTimeDigitized             : 93
[Composite]     SubSecCreateDate                : 2012:11:03 19:19:00.93
[Composite]     SubSecDateTimeOriginal          : 2012:11:03 19:19:00.93
[Composite]     SubSecModifyDate                : 2012:11:03 19:19:00.93

wywh

It should work (although I always use only single quotes ' because those double quotes " do not work with $ in Mac and Linux).

Check also 'MacOS:FileCreateDate' with '-api RequestAll=2' (I always use '-api QuickTimeUTC=1' although it does nothing with image files. It converts movie times from UTC to computer's local time):

exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All -api RequestAll=2 image.jpg
In macOS the set file date command asks for Xcode Command Line Tools install which can be ignored but then the FileCreateDate moves only backwards in time (the install is quite small and fast, not the huge Xcode install).

- Matti

Phil Harvey

...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 ($).

adiseker

Quote from: Phil Harvey on September 30, 2022, 06:04:54 AMRead the notes for FileCreateDate in the ExifTool Extra Tags documentation.

- Phil

Phil, I did read the note, I had already installed "setfile", but I don't know enough to understand the pieces in "On Mac, this tag is extracted only if it or the MacOS group is specifically requested or the API RequestAll option is set to 2 or higher." I'm one of those people that needs examples in order to learn, unfortunately. Also, my Perl knowledge is decades out of date.

I guess I'll try to figure out what to do. Thanks!

adiseker

Well, as usual when I try to explain an error I get, I stop getting the error!

For whatever reason, the command that I was using last night that failed, is no longer failing. I have no idea what happened (or didn't happen).

At any rate, thank you Phil for the tool, and thank you and  @wywh for your replies as well.