Skip to content

Instantly share code, notes, and snippets.

@zacharyliu
Created April 5, 2016 05:31
Show Gist options
  • Save zacharyliu/64e37830cf2cae90199f658494a1636b to your computer and use it in GitHub Desktop.
Save zacharyliu/64e37830cf2cae90199f658494a1636b to your computer and use it in GitHub Desktop.
Apply watermark.png at 25% size in lower left corner, and rename output to EXIF date
#!/bin/bash
for FILE in "$@"; do
ww=`convert $FILE -format "%[fx:w]" info:`
hh=`convert $FILE -format "%[fx:h]" info:`
datepath="$(identify -verbose $FILE | grep DateTimeOri | awk '{print $2"_"$3 }' | sed s%:%_%g)"
convert $FILE -auto-orient \( watermark.png -resize $((ww / 4))x$((hh / 4)) \) -gravity SouthWest -composite ${datepath}_overlay.jpg
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment