Update DateTimeOriginal Only If Missing

Started by hemangster, May 26, 2018, 05:08:24 PM

Previous topic - Next topic

hemangster

Hello,

Last night, I found photos that are missing the Date Taken EXIF data (along with other EXIF data, but the Date Taken is what I really want to fix). Here is my situation:

1. I am using Windows 10
2. I have a 'Pictures' folder with thousands of images
3. The filenames of all my images is: YYY-MM-DD-HH-MM-SS.jpg
3. Some images no longer have Date Taken EXIF data
4. Google Picasa is what deleted the EXIF data
5. I know I can run:

exiftool -P -ext jpg -overwrite_original "-datetimeoriginal<filename" "C:\Path\to\some\images

to fix the issue one directory at a time

6. I would like to find a command-line that would go through my entire image collection and add the missing DateTimeOriginal from the filename, but only if it is missing. I have years worth of images that are fine and I would like exiftool to skip those images.

Thanks.

StarGeek

Add -r to recurse through subdirectories. 

Add -if "not $DateTimeOriginal" to only target files that don't have a DateTimeOriginal tag.
* 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).

hemangster