Last active
August 29, 2015 14:11
-
-
Save wannyk/db7211c5115c9657c81e to your computer and use it in GitHub Desktop.
This file contains 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 | |
for f in $(ls *@2x.png) | |
do | |
filename=$(basename $f | sed 's/@2x././g') | |
echo $filename | |
H=$(sips -g pixelHeight "$f" | grep 'pixelHeight' | cut -d: -f2) | |
W=$(sips -g pixelWidth "$f" | grep 'pixelWidth' | cut -d: -f2) | |
H50=$(($H / 2)) | |
W50=$(($W / 2)) | |
sips --resampleHeight "$H50" "$f" >/dev/null | |
mv "$f" "$filename" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment