Skip to main content

A simple commandline tool to remove the EXIF data from image files.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

detect_exif-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

detect_exif-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for detect_exif-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3f94b457c70817d1108536e31492a5f10a400c76733b8153dbda2383cf360f8
MD5 6361ae3b06bbfaa0dba0a918f7de82c4
BLAKE2b-256 5e74e5c47e483aec146f8f99afeeabad85809427399acc950d65b72481a98404

See more details on using hashes here.

Provenance

The following attestation bundles were made for detect_exif-0.1.0.tar.gz:

Publisher: release-pypi.yml on olipinski/detect-exif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for detect_exif-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09882a65a4e64253be1bb6c8f2830f2f986f8a3a6d76d7fd1a056ce975176493
MD5 3a88a76213b66fe8e6b1457627de241d
BLAKE2b-256 6f35c3d5c5b287766b73c1076767ec7cc117ccc4812a236ffeecaaaf7efe76b9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page