Created
July 7, 2015 03:08
-
-
Save jamesmccann-zz/a5c9006760f611e90a88 to your computer and use it in GitHub Desktop.
iOS asset resize
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 -e | |
dir=$1 | |
if [[ -d $dir ]]; then | |
cd $dir | |
else | |
echo "ios-ar expects a directory as the first argument" | |
exit 1 | |
fi | |
for f in *; do | |
if [[ $f == *.png ]]; | |
then | |
echo "...$f" | |
convert $f -resize 180x180 "${f%%.*}-@3x.${f#*.}" | |
convert $f -resize 120x120 "${f%%.*}-@2x.${f#*.}" | |
convert $f -resize 76x76 "${f%%.*}-@1x.${f#*.}" | |
fi | |
done | |
echo "Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment