Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Created May 12, 2016 20:08
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 joswr1ght/f819db3b6a0ba447daa0a1d5dd4a82ff to your computer and use it in GitHub Desktop.
Save joswr1ght/f819db3b6a0ba447daa0a1d5dd4a82ff to your computer and use it in GitHub Desktop.
Add EXIF data about camera stuff to a JPG destructively using exiftool and ImageMagick
#!/bin/bash
if [ $# -lt 1 ] ; then
echo "WARNING: Will overwrite source image!"
echo "$0 [images]"
exit
fi
for IMAGE in "$@"; do
LENS=`exiftool -T -lens $1`
CREATEDATE=`exiftool -T -createdate $1`
FOCALLEN=`exiftool -T -focallength $1`
APERTURE=`exiftool -T -aperture $1`
SHUTTERSPEED=`exiftool -T -shutterspeed $1`
ISO=`exiftool -T -iso $1`
MODEL=`exiftool -T -model $1`
DATE=`echo $CREATEDATE | cut -d" " -f1 | sed 's/:/\//g'`
TIME=`echo $CREATEDATE | cut -d" " -f2`
LABEL=`echo $DATE $TIME $MODEL, $LENS - ISO $ISO $FOCALLEN f/$APERTURE $SHUTTERSPEED \(c\) Joshua Wright, All Rights Reserved`
convert $IMAGE -pointsize 80 -fill black -box 'rgba( 215, 215, 215 , 0.5 )' -gravity South -annotate +0+0 "$LABEL" $IMAGE
done
@joswr1ght
Copy link
Author

Produces a text box like the example shown here:

dsc_1263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment