Skip to content

Instantly share code, notes, and snippets.

@airicbear
Last active May 25, 2020 16:00
Show Gist options
  • Save airicbear/8836b3a2c2d516b7463bec0e69e97497 to your computer and use it in GitHub Desktop.
Save airicbear/8836b3a2c2d516b7463bec0e69e97497 to your computer and use it in GitHub Desktop.
# Create directory if it doesn't exist
[ -d ${1:-64} ] || mkdir ${1:-64}
# Put all resized images into the new directory
for file in *.jpg; do
magick "$file" -resize ${1:-64}x${1:-64} "./${1:-64}/${file%.jpg}_${1:-64}.jpg"
done
@airicbear
Copy link
Author

Usage: ./rsjpg.sh 64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment