Exiftool tips and tricks
Organize images
Section titled “Organize images”Organize images by years/months
exiftool -d "%Y/%m/%Y-%m-%d %H.%M.%S%%-c.%%le" "-filename<CreateDate" -r ./PhotosDownload RAW files from SD card to current folder:
exiftool -d "%Y/%m/%Y-%m-%d %H.%M.%S%%-c.%%le" "-filename<CreateDate" --ext raf -r /Volumes/SDMove all Olympus images to directory Olympus:
exiftool -r '-directory=Olympus' -if '$make eq "OLYMPUS CORPORATION"' .Rename files to datestamp:
Filename looks like 2014-01-01 12:00:00.jpg and will append -NUM if DateTimeOriginal is the same for multiple files
exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H.%M.%S%%-c.%%e" .Date & time
Section titled “Date & time”Find images in a directory that don’t have a DateTimeOriginal:
exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .Update any photo that doesn’t have DateTimeOriginal to have it based on file modify date:
exiftool '-datetimeoriginal<filemodifydate' -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' .Set date by filename:
exiftool "-alldates<filename" $@All metadata
Section titled “All metadata”Remove all metadata of a image file:
exiftool -all= -overwrite_original photo.jpgRemove all metadata of all *.jpg files in current directory:
exiftool -all= -overwrite_original -ext *.jpgStrip all metadata except for location (GPS):
exiftool -all= -tagsfromfile @ -gps:all *.jpgRemove all GPS metadata of *.jpg files in current directory:
exiftool -gps:all= *.jpgCreate KML from geotagged photos:
DESKTOP=$HOME/Desktopcat $DESKTOP/kml-start.fmt > out.kmlexiftool -n -r -q -p $DESKTOP/kml-placemark.fmt . >> out.kmlcat $DESKTOP/kml-end.fmt >> out.kmlCreate CSV of Geo Information:
exiftool -csv -filename -imagesize -gps:GPSLatitude -gps:GPSLongitude ./ > long.csvCheck Shutter Count:
exiftool -ImageCount [filename]Outputs a grouped collection of records as JSON in a directory:
exiftool -json -g /path > collectionprofile.json