Last active
May 30, 2017 12:23
-
-
Save chibi929/d5280e390270865ace2cc615d8a7cfde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! type convert > /dev/null 2>&1; then | |
echo 'Require: ImageMagick' | |
exit 1 | |
fi | |
if [ $# -ne 1 ]; then | |
echo 'Usage: bash image-resizer.sh ${IMAGE_FILE}' | |
exit 1 | |
fi | |
file=$1 | |
convert -resize 100% ${file} /tmp/${file%.*}@1x.png | |
convert -resize 200% ${file} /tmp/${file%.*}@2x.png | |
convert -resize 300% ${file} /tmp/${file%.*}@3x.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment