Created
August 15, 2012 02:24
-
-
Save eveliotc/3355017 to your computer and use it in GitHub Desktop.
Script to batch resize non 9patch images
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 | |
SRC_DIR=$1; # e.g. res/drawable-xhdpi/ | |
DEST_DIR=$2; # e.g. res/drawable-mdpi/ | |
RESIZE_BY=$3; # e.g. 50% | |
echo "From $SRC_DIR to $DEST_DIR resize by $RESIZE_BY"; | |
for item in $( ls $SRC_DIR | grep -v '\.9.png$' ); do | |
echo Resizing: $item | |
convert $SRC_DIR$item -resize $RESIZE_BY $DEST_DIR$item | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment