If you haven’t heard of the software utility, Exiftool, and you are passionate about the metadata associated with your images, then you definitely need to check it out. The software was written and contributed to the Internet community for free usage by Phil Harvey. Phil is from Kingston, Ontario, Canada and is now retired from a position at Queen’s University.
The standard program is run from the command line, but if that scares you there are implementations with a graphic interface on top of the core program. You can grab the standard program at exiftool.org.
In this post, we summarize a few of the Exiftool examples that we have come across over the years and these may help you accomplish a needed task with your photos. These are listed in no particular order. All examples assume you have unzipped Exiftool in the “C:\temp\exiftool folder”. And, if you are making changes to directories, image content or image names then please do a test on a small set of photos first; and make sure you have backups in case something goes awry!
- Find out if a picture is missing a particular exif property by running the following command. This example searches to find images WITHOUT the DateTimeOriginal exif property set: \temp\exiftool\exiftool -filename -r -if ‘(not $datetimeoriginal)’ *.jpg
- If you have pictures without the CreateDate exif property but with the DateTimeOriginal exif property. The following will set the CreateDate exif property to be the same as the DateTimeOriginal exif property: \temp\exiftool\exiftool ‘-createdate<datetimeoriginal’ -r -if ‘(not $createdate and $datetimeoriginal)’ *.jpg
- By writing a new value to the FileName and/or Directory tags, files can be renamed and/or moved to different directories. This can be a very powerful tool in combination with the -d (date format) option for organizing images by date/time. For example, the following command renames all images in directory “DIR” according to the individual file’s creation date in the form “YYYYmmdd_HHMMSS.ext”: \temp\exiftool\exiftool “-FileName<CreateDate” -d “%Y%m%d_%H%M%S.%%e” DIR
- Or a new directory can be specified by setting the value of the Directory tag. For example, the following command moves all images originally in directory “DIR” into a directory hierarchy organized by year/month/day: \temp\exiftool\exiftool “-Directory<DateTimeOriginal” -d “%Y/%m/%d” DIR
- If you have inherited images with bad XMP face tags, you can remove them in an image with: \temp\exiftool\exiftool -xmp-region:all= *.jpg
- For removing all metadata from a file: \temp\exiftool\exiftool -all= “Kim’s Graduation.jpg”
- The following will attempt to repair (JPGs only) the metadata where image name = bad.jpg : \temp\exiftool\exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile bad.jpg
- If you want to write existing metadata out to a text file (for image.jpg and text file name = image_tags.txt) : \temp\exiftool\exiftool -s -G image.jpg >image_tags.txt
- If you just want to dump the names from a set of image files: \temp\exiftool\exiftool -T -RegionPersonDisplayName -r *.jpg > PeopleTags.txt
- We have written an Excel macro that will take a dump of people names and remove any duplicates so you can see a list of unique names of people that may have attended an event… or have been in a set of pictures you have during the course of a year for example. Contact us to get the details for this – it is a little more complicated.
- Sometimes you may inherit images with duplicate name tags, and you don’t know what tag is accurate (bounding boxes for the face may be in the wrong place for one tag). We have also written an Excel macro to find those images where the duplicates exist in the same image. Then you can inspect the image and remove the offending tags.
There are many, many more tasks that Exiftool can accomplish. The above list only scratches the surface. The folks that monitor the exiftool forum are very diligent and can help with most issues related to “how to use exiftool” so if you hit a roadblock then can usually help out in short order.