ExifTool Forum

ExifTool => Newbies => Topic started by: hemangster on May 26, 2018, 05:08:24 PM

Title: Update DateTimeOriginal Only If Missing
Post by: hemangster on May 26, 2018, 05:08:24 PM
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.
Title: Re: Update DateTimeOriginal Only If Missing
Post by: StarGeek on May 26, 2018, 06:21:19 PM
Add -r to recurse through subdirectories. 

Add -if "not $DateTimeOriginal" to only target files that don't have a DateTimeOriginal tag.
Title: Re: Update DateTimeOriginal Only If Missing
Post by: hemangster on June 02, 2018, 05:44:49 PM
The above command worked. Thank you.