ExifTool Commands Cheat Sheet

• Updated November 21, 2019


ExifTool by Phil Harvey is a fantastic tool to edit the exif metadata on your pictures. It is especially useful when you have a lot of pictures to edit and have no desire to change metadata by hand.

This post will be an ever growing list of useful exiftool commands and scripts.

Remove Exif Properties from Pictures

If you are uploading a picture to a public website, it would be wise to scrub any exif properties - especially if there are GPS exif properties. You can do this with the following command:

exiftool -all= picture.jpg

If you are in a directory with many pictures that you want to scrub the exif data from, you can use a wildcard to process them all:

exiftool -all= *.jpg

Find Files Missing Exif Properties

You can quickly figure out if a picture is missing a particular exif property by running the following command. In this example, I want to see if my picture has the DateTimeOriginal exif property set:

exiftool -filename -r -if '(not $datetimeoriginal)' /path/to/picture.jpg

If you have a folder of pictures to check, or even a folder contaning even more folders of pictures, you can simply replace /path/to/picture.jpg with /path/to/picture/directory/:

exiftool -filename -r -if '(not $datetimeoriginal)' /path/to/picture/directory/

The picture does not have the DateTimeOriginal exif property if its file name is returned.

Ryan M provides more insight into finding and fixing images with no exif dates.

Add CreateDate Exif Property to a Picture

If your picture was taken on June 29, 2007 at 1:38:55 PM, you can add the CreateDate exif property to your picture with the following command:

exiftool -createdate="2007:06:19 13:38:55" /path/to/picture.jpg

Add CreateDate Exif Property and Copy DateTimeOriginal Exif Property Value to It

I had a situation where many of my pictures did not have the CreateDate exif property but they did have the DateTimeOriginal exif property. I wanted the CreateDate exif property to have the same value as the DateTimeOriginal exif property. ExifTool’s if functionality makes this easy to fix:

exiftool '-createdate<datetimeoriginal' -r -if '(not $createdate and $datetimeoriginal)' /path/to/picture/directory/

ExifTool will always copy the original picture and then make its modifications. If you want it to overwrite the original picture, add -overwrite_original_in_place to the exiftool command line.

References

If you found this post useful, you can help support this site and get something for yourself by signing up for any of the services listed below through the provided links.

The following links are part of affiliate programs, and I will receive a referral payment from any of the services you sign-up for.

  • Get Faster Shipping: Perhaps you're about to order some stuff on Amazon but want to get more value out of the money you would normally pay for shipping. Sign-up for a free, 30-day trial of Amazon Prime to get free two-day shipping, access to thousands of movies and TV shows, and more.
  • Start Investing Now: Are you looking to start investing some of your disposable saved income? Get started by opening an account with Webull, where upon sign-up and opening a brokerage account with an initial deposit of at least $100 you will receive 1 stock valued (subject to change based on normal market movement) between $8 and $1600.

Thanks for reading and take care.