Skip to content

Instantly share code, notes, and snippets.

@amarcadet
Created March 21, 2012 21:55
Show Gist options
  • Save amarcadet/2153501 to your computer and use it in GitHub Desktop.
Save amarcadet/2153501 to your computer and use it in GitHub Desktop.
Shells scripts to compress/decompress optimized PNG files for iOS
if [ ! -d "crushed" ]; then
mkdir crushed
fi
if [ -d "/Applications/Xcode.app/" ]; then
# Xcode 4.3 and later
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir crushed -iphone -q *.png
else
# Previous Xcode 4.3
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir crushed -iphone -q *.png
fi
if [ ! -d "uncrushed" ]; then
mkdir uncrushed
fi
if [ -d "/Applications/Xcode.app/" ]; then
# Xcode 4.3 and later
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir uncrushed -revert-iphone-optimizations -q *.png
else
# Previous Xcode 4.3
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir uncrushed -revert-iphone-optimizations -q *.png
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment