https://github.com/stefmolin/exif-stripper
An easy-to-use tool to ensure image metadata (EXIF) is removed.
https://github.com/stefmolin/exif-stripper
exif exif-metadata metadata-remover pre-commit-hook
Last synced: 2 days ago
JSON representation
An easy-to-use tool to ensure image metadata (EXIF) is removed.
- Host: GitHub
- URL: https://github.com/stefmolin/exif-stripper
- Owner: stefmolin
- License: apache-2.0
- Created: 2024-01-15T23:40:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-04-26T17:29:08.000Z (about 2 months ago)
- Last Synced: 2026-05-10T12:03:01.737Z (about 1 month ago)
- Topics: exif, exif-metadata, metadata-remover, pre-commit-hook
- Language: Python
- Homepage: https://pypi.org/project/exif-stripper/
- Size: 229 KB
- Stars: 33
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-pyladies-creations - exif-stripper
README
# exif-stripper
An easy-to-use tool to ensure image EXIF metadata is removed. Read more about why this is important [here](https://stefaniemolin.com/articles/devx/pre-commit/exif-stripper/).
## Usage
### Pre-commit hook
Add the following to your `.pre-commit-config.yaml` file:
```yaml
- repo: https://github.com/stefmolin/exif-stripper
rev:
hooks:
- id: strip-exif
```
If 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:
```yaml
- repo: https://github.com/stefmolin/exif-stripper
rev:
hooks:
- id: strip-exif
args: [--fields=gps]
```
Be sure to check out the [pre-commit documentation](https://pre-commit.com/#pre-commit-configyaml---hooks) for additional configuration options.
### Command line
First, install the `exif-stripper` package from PyPI:
```shell
$ python -m pip install exif-stripper
```
Then, use the `exif-stripper` entry point on the file(s) of your choice (use `strip-exif` for versions before 0.6.0):
```shell
$ exif-stripper /path/to/file [/path/to/another/file]
```
Run `exif-stripper --help` for more information.
### Python
First, install the `exif-stripper` package from PyPI:
```shell
$ python -m pip install exif-stripper
```
Then, use the `process_image()` function on individual files (returns `True` if the file was altered and `False` otherwise):
```python
from exif_stripper import process_image
process_image('/path/to/image')
```
*Note: This requires version 0.4.0 or above.*
## Contributing
Please consult the [contributing guidelines](https://github.com/stefmolin/exif-stripper/blob/main/CONTRIBUTING.md).