Skip to content

Instantly share code, notes, and snippets.

@ftp27
Last active August 29, 2015 14: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 ftp27/b4b675e0a8453df1832d to your computer and use it in GitHub Desktop.
Save ftp27/b4b675e0a8453df1832d to your computer and use it in GitHub Desktop.
Create Android image set
#!/bin/bash
function createDir {
if [ ! -d $1 ]; then
mkdir $1
fi
}
createDir imageset
createDir imageset/drawable-xxxhdpi
createDir imageset/drawable-xxhdpi
createDir imageset/drawable-xhdpi
createDir imageset/drawable-hdpi
createDir imageset/drawable-mdpi
cp $1 imageset/drawable-xxxhdpi/$1
convert -resize 75% $1 imageset/drawable-xxhdpi/$1
convert -resize 50% $1 imageset/drawable-xhdpi/$1
convert -resize 37.5% $1 imageset/drawable-hdpi/$1
convert -resize 25% $1 imageset/drawable-mdpi/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment