Last active
August 29, 2015 14:10
-
-
Save gre/273aec2673d7d40a068a to your computer and use it in GitHub Desktop.
Annotate photos with the date. in white. corner bottom right. size of the font relative to the photo resolution.
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
out=`pwd`/OUT | |
rm -rf $out | |
mkdir $out || exit; | |
for d in raw/*; do | |
if [ -d $d ]; then | |
cd $d || exit; | |
mkdir $out/$d || exit; | |
for f in *; do | |
echo "$f => $out/$d/$f"; | |
text=`exiftool -d '%d %b %Y' $f | grep 'Time Original' | head -n 1 | cut -f2 -d':'`; | |
size=`exiftool $f | egrep "Width|Height" | cut -f2 -d':' | sort -nr | head -1` | |
size=$((size / 64)) | |
convert $f -font Helvetica -pointsize $size -gravity SouthEast \ | |
-stroke none -fill white -annotate +$size+$((size/2)) "$text" \ | |
$out/$d/$f; | |
done; | |
cd ..; | |
fi; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment