Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for annotation of EXIF-date on photos
#!/bin/bash
[[ ! -z $1 ]] && [[ -d $1 ]] && input_dir=$1 || input_dir=`pwd`
file_mask="*.JPG"
font_name="DejaVu-Sans-Book" # see all available variants: convert -list font|grep Font
output_dir="output"
color=white
font_size=32
cd ${input_dir}
mkdir -p ${output_dir}
IFS=$'\n'
for f in `ls -1 ${file_mask}`
do
convert "${f}" -auto-orient -font ${font_name} -pointsize ${font_size} \
-stroke '#000C' -strokewidth 5 -annotate +50+50 %[exif:DateTimeOriginal] \
-stroke none -fill ${color} -annotate +50+50 %[exif:DateTimeOriginal] ${output_dir}/"${f}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.