Skip to content

Instantly share code, notes, and snippets.

@tatyusa
Created September 7, 2013 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatyusa/6473181 to your computer and use it in GitHub Desktop.
Save tatyusa/6473181 to your computer and use it in GitHub Desktop.
Script to generate Retina conpatible iamge.
#!/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