Changing the Date Taken to match the Date Modified without the latter updating

Started by Exifdude, November 05, 2017, 03:00:39 PM

Previous topic - Next topic

Exifdude

I'd like to change the "Date Taken" field to match the "Date Modified" field so both values are the same.  If I run this command,
exiftool "-datetimeoriginal<filemodifydate" DIR
It changes the Date Taken field to what the Date Modified was, but then since the file was modified the Date Modified field changes to the current date/time.  Thank you for any help in advance.

Phil Harvey

Add the -P option to preserve the original file modification date/time.

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

Exifdude

Thank you so much Phil and I really appreciate you creating this app, it has become indispensable in cleaning up my photo archive.

Exifdude

After I ran the command with the -P option, exiftool "-datetimeoriginal<filemodifydate" -P DIR, it creates a copy of every file preserving the original file by renaming it "example.jpg_original".  Is there a command that would delete that file after the new file is created?

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype


Exifdude

What would be the macOS equivalent of this command?  I'm running into difficulties replicating this on my Mac.

exiftool '-datetimeoriginal<filemodifydate' –P –overwrite_original DIR

StarGeek

What are the exact difficulties you're running into?  The command shouldn't do anything differently on a different OS.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Exifdude

After running this command it does not delete the "_original" file and the Modified Date changes to when the command was executed as the switches –P and –overwrite_original error out.

laptop:~ user$ exiftool '-datetimeoriginal<filemodifydate' –P –overwrite_original /Users/x/
Warning: Error opening file - –P
Error: File not found - –P
Warning: Error opening file - –overwrite_original
Error: File not found - –overwrite_original
    1 directories scanned
   13 image files updated
    2 files weren't updated due to errors

ekkidee

Somehow you got a funky character in there:

laptop:~ user$ exiftool '-datetimeoriginal<filemodifydate' –P –overwrite_original /Users/x/

Note:

–P
vs.
-P

The first is some extended unicode character. Probably a bad copy/paste from somewhere. Pull it up in an editor and overtype it with a real dash.

Also on -overwrite_Original too, same unicode character (0x2013).

StarGeek

You copied the command too/from a word processor or something along those lines.  Word processors will "fix" certain characters to be more in line with printing.  In this case, you no longer have hyphens, you more likely have a ndash (a quick copy and check from your post confirms this).  That's why the error returns that it sees "–P" and "–overwrite_original" as  files, not a exiftool argument.  Retype it with actual hyphens and it should work.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype