Skip to content

Instantly share code, notes, and snippets.

@eveliotc
Created August 15, 2012 02:24
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 eveliotc/3355017 to your computer and use it in GitHub Desktop.
Save eveliotc/3355017 to your computer and use it in GitHub Desktop.
Script to batch resize non 9patch images
#!/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