Skip to content

Instantly share code, notes, and snippets.

@inverse
Last active March 11, 2018 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inverse/fbe430cc8f89d8242a41de4c4a0d68b1 to your computer and use it in GitHub Desktop.
Save inverse/fbe430cc8f89d8242a41de4c4a0d68b1 to your computer and use it in GitHub Desktop.
Process Photos
#!/bin/bash
# Dependencies
#
# - exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/)
# - sortphotos (https://github.com/andrewning/sortphotos)
#
if ! [ -x "$(command -v exiftool)" ]; then
echo 'Error: exiftool is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v sortphotos)" ]; then
echo 'Error: sortphotos is not installed.' >&2
exit 1
fi
if [ "$#" -ne 2 ]
then
echo "Usage: ./photoProcess.sh [input-dir] [output-dir]'"
exit 1
fi
INPUT_DIR=$1
OUTPUT_DIR=$2
# Clean invalid creation dates: see https://code.google.com/p/android/issues/detail?id=53106
exiftool -EXIF:CreateDate= $INPUT_DIR*.jpg
# Process images/videos into output directory
sortphotos $INPUT_DIR $OUTPUT_DIR -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment