Last active
March 11, 2018 20:04
-
-
Save inverse/fbe430cc8f89d8242a41de4c4a0d68b1 to your computer and use it in GitHub Desktop.
Process Photos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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