Skip to content

Instantly share code, notes, and snippets.

@tungd
Last active March 2, 2016 11:32
Show Gist options
  • Save tungd/3a55a02e3686b5b2e11a to your computer and use it in GitHub Desktop.
Save tungd/3a55a02e3686b5b2e11a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
BATCH_SIZE=250
mkdir output
count=0
for file in *.jpg; do
convert -resize 256x256\! "$file" "output/$file" &
let count+=1
[[ $((count % BATCH_SIZE)) -eq 0 ]] && sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment