Saturday 20 February 2016

Writing missing/incorrect Date Tags based on FileName in ExifTool?


I'm using Linux Mint and have about 2,000 images which have either incorrect or missing EXIF Date tags. I would like to use the date contained in the filename to write the tags. I've spent a few hours trying to figure out how to do this in ExifTool but haven't managed to get very far unfortunately.


The files are in the format: YYYYMMDD_HHMMSS.jpg. However there are some duplicate filenames (different images though, so I can't just delete the duplicates) which are of the format YYYMMDD_HHMMSS(1).jpg. Lastly, there are some images which were shot in burst mode and are of the format YYYYMMDD_HHMMSS_001.jpg.


I'm familiar with the basics of Python so was able to tidy up some other naming issues and get the files to a point where the first 15 characters of every file name adhere to the same format. So I was hoping I could somehow use just the first 15 characters of each file as input to write the tags. I think I need something along the lines of:


exiftool '-AllDates<$Filename...'


...but I cant figure out how to do the advanced formatting which needs to go on the end. Would someone be able to help me out?


I did see this question but it didn't help in my case.




Answer



You command is mostly correct as written. See Exiftool FAQ #5, 3rd paragraph.


The only suggestion I have is to remove the dollar sign, as it would be unneeded for this operation.


exiftool '-Alldates


This command creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...