Created
August 31, 2010 04:23
-
-
Save atnan/558541 to your computer and use it in GitHub Desktop.
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
# | |
# Takes a PNG that has been optimised by Xcode for display on iOS devices, and | |
# creates a new, unoptimised file that can be opened in Preview. If you don't | |
# supply a second argument, the output file will be named in-uncrushed.png | |
# | |
# See: http://developer.apple.com/iphone/library/qa/qa2010/qa1681.html | |
# | |
function uncrush() { | |
local infile="$1"; local outfile="$2" | |
if [[ -z $infile ]]; then | |
echo -e "Usage:\n\tuncrush in.png\n\tuncrush in.png out.png" | |
fi | |
if [[ -z $outfile ]]; then | |
local outprefix=${infile%\.*} | |
outfile="$outprefix-uncrushed.png" | |
fi | |
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations -q $infile $outfile | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment