A simple commandline tool to remove the EXIF data from image files.
Project description
detect-exif
A Python tool that detects and optionally removes sensitive EXIF metadata from image files. Works as both a standalone command-line utility and a pre-commit hook to prevent accidentally committing images with private data.
Why detect-exif?
Images often contain hidden metadata like:
- GPS coordinates of where a photo was taken
- Camera make, model, and serial number
- Date and time information
- Software/firmware details
- Copyright information
- Names, comments, and other personally identifiable data
This tool helps protect your privacy by:
- Detecting sensitive EXIF data in your images
- Highlighting specifically concerning information (GPS data, device details)
- Optionally removing all metadata while preserving the image itself
Features
- Detects various types of sensitive EXIF data in JPG, PNG, and WebP images
- Special checking for GPS coordinates with human-readable output
- Preserves image orientation when removing EXIF data
- Works as a pre-commit hook to detect images with sensitive metadata before commit
- Optional automatic removal of EXIF data (both in CLI and pre-commit hook)
- Integrated with pre-commit hook ecosystem
Installation
pip install detect-exif
Usage
As a Command-Line Tool
Check images for EXIF data (standard output):
detect-exif path/to/image.jpg path/to/another.jpg
Remove EXIF data:
detect-exif --remove path/to/image.jpg path/to/another.jpg
For quieter output (useful in scripts and pre-commit hooks):
detect-exif --quiet path/to/image.jpg
For detailed output with full information:
detect-exif --verbose path/to/image.jpg
As a Pre-Commit Hook
Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/olipinski/detect-exif
rev: v0.1.0 # Use the latest version
hooks:
- id: detect-exif
# By default, the hook only detects EXIF data with minimal output
# To enable automatic removal, add:
# args: [--remove]
# For detailed output, add:
# args: [--verbose]
# For both removal and detailed output:
# args: [--remove, --verbose]
License
MIT License - See LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file detect_exif-0.1.0.tar.gz.
File metadata
- Download URL: detect_exif-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3f94b457c70817d1108536e31492a5f10a400c76733b8153dbda2383cf360f8
|
|
| MD5 |
6361ae3b06bbfaa0dba0a918f7de82c4
|
|
| BLAKE2b-256 |
5e74e5c47e483aec146f8f99afeeabad85809427399acc950d65b72481a98404
|
Provenance
The following attestation bundles were made for detect_exif-0.1.0.tar.gz:
Publisher:
release-pypi.yml on olipinski/detect-exif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
detect_exif-0.1.0.tar.gz -
Subject digest:
c3f94b457c70817d1108536e31492a5f10a400c76733b8153dbda2383cf360f8 - Sigstore transparency entry: 194568194
- Sigstore integration time:
-
Permalink:
olipinski/detect-exif@54a845f501e4bedaa1c2602594d361b19c4f3f0c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/olipinski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@54a845f501e4bedaa1c2602594d361b19c4f3f0c -
Trigger Event:
release
-
Statement type:
File details
Details for the file detect_exif-0.1.0-py3-none-any.whl.
File metadata
- Download URL: detect_exif-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09882a65a4e64253be1bb6c8f2830f2f986f8a3a6d76d7fd1a056ce975176493
|
|
| MD5 |
3a88a76213b66fe8e6b1457627de241d
|
|
| BLAKE2b-256 |
6f35c3d5c5b287766b73c1076767ec7cc117ccc4812a236ffeecaaaf7efe76b9
|
Provenance
The following attestation bundles were made for detect_exif-0.1.0-py3-none-any.whl:
Publisher:
release-pypi.yml on olipinski/detect-exif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
detect_exif-0.1.0-py3-none-any.whl -
Subject digest:
09882a65a4e64253be1bb6c8f2830f2f986f8a3a6d76d7fd1a056ce975176493 - Sigstore transparency entry: 194568195
- Sigstore integration time:
-
Permalink:
olipinski/detect-exif@54a845f501e4bedaa1c2602594d361b19c4f3f0c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/olipinski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@54a845f501e4bedaa1c2602594d361b19c4f3f0c -
Trigger Event:
release
-
Statement type: