Created
September 7, 2013 06:02
-
-
Save tatyusa/6473181 to your computer and use it in GitHub Desktop.
Script to generate Retina conpatible iamge.
This file contains hidden or 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 | |
# How to use | |
# $makeRetinaImages.sh folder_name | |
# The folder name should end by '/'. | |
# | |
for file in `ls $1`; do | |
if expr "$file" : ".*\.png" >/dev/null; then | |
file2x=`echo $file|sed 's/\(.*\)\(\.png\)/\1\@2x\2/'` | |
mv $1$file $1$file2x | |
convert -geometry 50% $1$file2x $1$file | |
else | |
echo "only support .png file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment