Skip to content

Instantly share code, notes, and snippets.

@atnan
Created August 31, 2010 04:23
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 atnan/558541 to your computer and use it in GitHub Desktop.
Save atnan/558541 to your computer and use it in GitHub Desktop.
#
# 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