An easy-to-use tool to ensure image EXIF metadata is removed. Read more about why this is important here.
Add the following to your .pre-commit-config.yaml file:
- repo: https://github.com/stefmolin/exif-stripper
rev: <version>
hooks:
- id: strip-exifIf you only want to remove certain fields, use the --fields argument. Note that this argument supports multiple options, which are shown when running exif-stripper --help. Be very careful when doing this as you might be leaving some sensitive information behind. Here, we only remove GPS information:
- repo: https://github.com/stefmolin/exif-stripper
rev: <version>
hooks:
- id: strip-exif
args: [--fields=gps]Be sure to check out the pre-commit documentation for additional configuration options.
First, install the exif-stripper package from PyPI:
$ python -m pip install exif-stripperThen, use the exif-stripper entry point on the file(s) of your choice (use strip-exif for versions before 0.6.0):
$ exif-stripper /path/to/file [/path/to/another/file]Run exif-stripper --help for more information.
First, install the exif-stripper package from PyPI:
$ python -m pip install exif-stripperThen, use the process_image() function on individual files (returns True if the file was altered and False otherwise):
from exif_stripper import process_image
process_image('/path/to/image')Note: This requires version 0.4.0 or above.
Please consult the contributing guidelines.