Skip to content

Instantly share code, notes, and snippets.

@pfaocle
Last active December 21, 2015 03:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfaocle/6241640 to your computer and use it in GitHub Desktop.
Save pfaocle/6241640 to your computer and use it in GitHub Desktop.
Use exiftool to fiddle the dates on photos (when I forget to set the date/time correctly on my camera).
#!/bin/sh
FILE_FORMAT="JPG"
# Show dates of all JPG files in current directory, in human readable format.
exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s -ext $FILE_FORMAT .
# Fiddle the dates - some date fields forward.
# Format is Y:M:D h:m:s
exiftool -F -AllDates+="2:6:0 0" *$FILE_FORMAT
# Fiddle the dates - some date fields backward.
exiftool -F -AllDates-="0:0:3 0" *$FILE_FORMAT
# Remove back-ups created by exiftool.
exiftool -delete_original! *$FILEFORMAT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment