Skip to content

Instantly share code, notes, and snippets.

@rringler
Created October 15, 2017 18:43
Show Gist options
  • Save rringler/2832af3612f1b8ee7eada5b7023c374e to your computer and use it in GitHub Desktop.
Save rringler/2832af3612f1b8ee7eada5b7023c374e to your computer and use it in GitHub Desktop.
path=$(dirname "$1")
basename="animated"
filename="animated.gif"
counter="0"
while [ -e "$path/$filename" ]; do
((counter++))
filename="$basename ($counter).gif"
done
/usr/local/bin/convert -delay 20 -loop 0 -resize 50% "$@" "$path/$filename"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment