Skip to content

Instantly share code, notes, and snippets.

@guyhughes
Last active August 29, 2015 13:56
Show Gist options
  • Save guyhughes/9225194 to your computer and use it in GitHub Desktop.
Save guyhughes/9225194 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
echo "WARNING: This is a one way operation on a single file."
echo "WARNING: Errors will be printed to console."
echo "Enter image filename to be sanitized: "
read theimage
mogrify -strip "$theimage"
xattr -c "$theimage"

How to sanitize an image on OSX

  1. Install imagemagick with homebrew : brew install imagemagick

  2. Use mogrify to strip EXIF data and comments: mogrify -strip ./image.jpg

  3. Check for OSX wherefroms: mdls ./image.jpg

  4. If there are any, delete them; they are nasty: xattr -c ./image.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment