Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Android XXHDPI Resizer (Tested on OS X Mavericks)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
eval "argv[${foo}]=\$${foo}"
width=$(sips -g pixelWidth $filename | tr -d '\n' | awk '{ print $NF }')
sips --resampleWidth $(($width/3)) "${f}/${filename}" --out "${f}/drawable-mdpi/${filename}"
sips --resampleWidth $(($width/2)) "${f}/${filename}" --out "${f}/drawable-hdpi/${filename}"
sips --resampleWidth $(($width/3*2)) "${f}/${filename}" --out "${f}/drawable-xhdpi/${filename}"
sips --resampleWidth $width "${f}/${filename}" --out "${f}/drawable-xxhdpi/${filename}"

This comment has been minimized.

Copy link

commented Mar 9, 2014

Tio, havies vist aquesta lib?

En principi arregla el teu problema no?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.