Using BASH on a Mac to set Capture Date, if blank, using Creation Date

Started by MarcRJacobs, November 23, 2020, 02:28:16 PM

Previous topic - Next topic

MarcRJacobs

Hi;

I get a lot of photos from family overseas via WhatsApp and Instagram. None of these have a Capture Date. If there is way to use a BASH script to call EXIFTOOL and set only blank Capture Dates to the Creation Date in a folder of these downloaded images?

Thank you for any assistance,
Marc

StarGeek

There would be no need to use a script, as exiftool has very powerful batch ability on its own.

You would need to figure out what tag is your "Capture Date" and "Creation Date" are.

Run this command on one of the files that is already set properly
exiftool -time:all -g1 -a -s /path/to/files/
That will show you all the timestamps in the file.  You can then figure out which tag is your source and which is your destination.  From there your command would be along these lines
exiftool -if 'not $DESTINATION_TAG' '-DESTINATION_TAG<SOURCE_TAG' /path/to/files/

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).


MarcRJacobs

Hi;

I'm having the same problems, were you able to make this work? And if so, could you give me a clue how?

Thanks,
Marc

StarGeek

What part are you having problems with?

I can't be of more help without a lot more info.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).