Skip to content

Instantly share code, notes, and snippets.

@enkiusz
Created June 22, 2020 13:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enkiusz/639634c0ff39fe8a9857e23f9e96bf7d to your computer and use it in GitHub Desktop.
Save enkiusz/639634c0ff39fe8a9857e23f9e96bf7d to your computer and use it in GitHub Desktop.
Set this as a pre-commit hook to anonymize images in your repository
#!/bin/sh
echo "Removing EXIF metadata"
if ! which exiv2 > /dev/null; then
echo "Please install the exiv2 tool"
exit 0
fi
find . -iname '*.png' -or -iname '*.jpg' -print0 | xargs -0 exiv2 -d a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment