Exiftool

ExifTool is the most common and used software to handle file metadata, specifically image information.



Cheat Sheet

Show metadata

exiftool -s -G filename.jpg

where:

  • -s is used to show the names in ExifTool commands format. e.g.: instead of Create Date you see CreateDate
  • -G is used to show the metadata Group to which the metadata tag belongs.

Show dates

exiftool -AllDates filename.jpg

Strip metadata

Removing all metadata from all files in pwd

exiftool -all= ./* #filename.jpg

Renaming according to original date

Rename all files in pwd, according to the time and time they were shot

exiftool '-FileName=CustomName%-c.%le' '-FileName<CreateDate' '-FileName<GPSDateTime' '-FileName<DateTimeOriginal' -d %Y.%m.%d-%H.%M.%S%%-lc.%%le -r ./*

where:

  • -r makes the analysis recursive;
  • -d is used to specify the printed date format;
  • %c adds a counter to images that result to be shot in the same second, l makes the counter alphabetical and the leading dash, guess what, adds a dash when the counter is used.
  • % for non-date variables must be double
  • adding -o copies each image instead of moving it.

During the file renaming process, the leftmost values are overwritten by the rightmost ones. Therefore, if a file both has CreateDate and DateTimeOriginal, the latter will overwrite the former. This is so in order to prioritize most reliable date values, as discussed in this thread in the ExifTool forum.


Directories

Organize files in directories based on each image’s dimensions (resolution)

exiftool '-Directory<imagesize' ./*

Move files to folders based on year and month

exiftool '-Directory<CreateDate' '-Directory<GPSDateTime' '-Directory<DateTimeOriginal' ./%Y/%Y.%m -r ./*


Resources

Share

Comments