Skip to content

Instantly share code, notes, and snippets.

@manishrjain
Last active September 15, 2015 06:59
Show Gist options
  • Save manishrjain/9e0a00aa1696e24f4333 to your computer and use it in GitHub Desktop.
Save manishrjain/9e0a00aa1696e24f4333 to your computer and use it in GitHub Desktop.
Script to set DateTimeOriginal exif recursively
# This script would set all pics to the same date, but ensures
# that each pic has a different hour and minute. This is useful
# to ensure locality of files when librarian/organize generates
# file names from their exif datetime.
let h=8
let m=0
find . -type f -name "*.JPG" | while read -r path
do
let m+=1
if [ $m -ge 60 ]; then
let m=0
let h+=1
fi
echo "$path => $h:$m"
exiftool -DateTimeOriginal="2013:10:15 $h:$m:00" "$path"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment