Skip to main content

detect-exif

pre-commit Code style: black

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:

  1. Detecting sensitive EXIF data in your images
  2. Highlighting specifically concerning information (GPS data, device details)
  3. 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

Metadata

Release files for detect-exif 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detect-exif 0.1.0
File Size Uploaded
detect_exif-0.1.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for detect-exif 0.1.0
File Interpreter ABI Platform
detect_exif-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / detect_exif-0.1.0.tar.gz

Download URL detect_exif-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c3f94b457c70817d1108536e31492a5f10a400c76733b8153dbda2383cf360f8
BLAKE2b-256 checksum
How to use checksums
5e74e5c47e483aec146f8f99afeeabad85809427399acc950d65b72481a98404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Release files / detect_exif-0.1.0-py3-none-any.whl

Download URL detect_exif-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09882a65a4e64253be1bb6c8f2830f2f986f8a3a6d76d7fd1a056ce975176493
BLAKE2b-256 checksum
How to use checksums
6f35c3d5c5b287766b73c1076767ec7cc117ccc4812a236ffeecaaaf7efe76b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page