Change creation date

Started by Flemming, September 30, 2018, 08:45:45 AM

Previous topic - Next topic

Flemming

Hi

I have trouble changeing my DNG (raw files) creation date to exif real photo take date. I am on a mac using Hazel to run at shell script.

==========
exiftool -P -d '%Y-%m-%d %H%M%S' \
    '-DateTimeOriginal<${CreateDate;}.%e' \
    '-FileModifyDate<${CreateDate;}.%e' \
    '-filename<${FileModifyDate;}.%e' \
    '-filename<${GPSDateTime;}.%e' \
    '-filename<${MediaCreateDate;}.%e' \
    '-filename<${ModifyDate;}.%e' \
    '-filename<${DateTimeOriginal;}.%e' \
    "$1"

=======
If I take these lines out the script renames the file correct but since the mac looks at the file creation date and not exif photo taken date it is not moved correct.
   '-DateTimeOriginal<${CreateDate;}.%e' \
   '-FileModifyDate<${CreateDate;}.%e' \

HELP :)

Phil Harvey

First of all, adding the ".%e" (file extension) doesn't make sense when writing a date/time tag.

I am assuming that you want to set the EXIF dates from the filesystem creation date:

Just using "-datetimeoriginal<filecreatedate#" should work to set the EXIF DateTimeOriginal from the file creation date, but I would use "-alldates<filecreatedate#" to also set ModifyDate and CreateDate..  But then you need '-filename<$filecreatedate.%e' if you also want to rename the file according to the filesystem creation date.

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

Flemming

#2
I what to change filesystem dates to the dates keept in EXIF.

exiftool -P -d '%Y-%m-%d %H%M%S' \
   '-alldates<filecreatedate#' \
   '-filename<${FileModifyDate;}.%e' \
    '-filename<${GPSDateTime;}.%e' \
    '-filename<${MediaCreateDate;}.%e' \
    '-filename<${ModifyDate;}.%e' \
    '-filename<${DateTimeOriginal;}.%e' \
    "$1"

dos not work too :(

=====
exiftool -P -d '%Y-%m-%d %H%M%S' \
'-filecreatedate<datetimeoriginal#' \
'-filename<$datetimeoriginal.%e' \
    "$1"
=====

This script changes filename to the right exif date, but it dos not change the date in file system!! File create date is still not the same as EXIF (real) date.

Phil Harvey

From the Tag Name documentation for FileCreateDate:

Requires "setfile" for writing on Mac

Do you have the "setfile" command-line utility installed?

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

Flemming

yes I have setfile installed  8)

Phil Harvey

So it should work.  Try adding -v3 to the command to get more details about what ExifTool is doing.

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