ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: dawgsontop on May 13, 2023, 10:02:34 AM

Title: Command Unintentially Rewriting Capture Date
Post by: dawgsontop on May 13, 2023, 10:02:34 AM
Hello all! The command below is what I've been using to organize years of photos and I've been taking advantage of PhotoMechanic's catalog feature, but I noticed that the capture date on some photos has been rewritten to the date that I ran the command. Is there a way to fix this because the file's modification date is still correct but the creation date is now the date that I ran the command, also this problem seems to only be effecting JPEG files.

exiftool -v -d 'DESTINATION/%Y/%m/%Y-%m-%d/%%f%%-c.%%e'  '-filename<CreateDate' '-filename<DateTimeOriginal' '-filename<FileModifyDate' -r SOURCE
Title: Re: Command Unintentially Rewriting Capture Date
Post by: StarGeek on May 13, 2023, 11:50:30 AM
Quote from: dawgsontop on May 13, 2023, 10:02:34 AMIs there a way to fix this because the file's modification date is still correct but the creation date is now the date that I ran the command, also this problem seems to only be effecting JPEG files.

Try running the command in FAQ #3 (https://exiftool.org/faq.html#Q3) on a file before and after you run your command.  Then compare the two outputs to see what is different.

Your command above doesn't actually edit the files.  The only thing exiftool is changing is the filename.  Unless "DESTINATION" is a local drive, then nothing else has been changed.  A network drive or an older file system such as FAT32 might end up with a different FileCreateDate/FileModifyDate, but you said that hasn't changed.

You'll have to test tags on the PhotoMechanic side, i.e. change something in a test file, reload, repeat, to figure out what is happening.

One thing to note about your command.  You have placed '-filename<FileModifyDate' at the end of your command.  When using multiple assignments to the same tag name, in this case Filename, the last valid assignment takes precedence. As FileModifyDate is always there, the previous assignments will never take place.

I beleive what you really want would be
'-filename<FileModifyDate' '-filename<CreateDate' '-filename<DateTimeOriginal'
This command would use DateTimeOriginal first if it exists, then fall back to CreateDate, then fall back to FileModifyDate only if the other two tags didn't exist.