Skip to content

Instantly share code, notes, and snippets.

@onyxmueller
Last active October 25, 2015 11:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onyxmueller/4834a05154290e224c61 to your computer and use it in GitHub Desktop.
Save onyxmueller/4834a05154290e224c61 to your computer and use it in GitHub Desktop.
A Bash shell script to strip metadata from Android PNG resources.
#!/bin/bash
#
# Get rid of 'libpng warning: iCCP: Not recognizing known sRGB profile that has been edited' compilation warnings
# from AAPT by running this Bash shell script in the root folder of your Android project. This will use exiftool
# to remove PNG metadata (created by tools like Photoshop) from your Android project's PNG resources.
#
# NOTE: exiftool needs to be installed and in your path. Install it using homebrew or some other method.
#
command -v exiftool >/dev/null 2>&1 || { echo >&2 "exiftool is required but is not installed. Try installing exiftool with homebrew. Aborting."; exit 1; }
find . -regex '.*/src/main/res/.*png' -exec exiftool -overwrite_original -all= {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment