Python library designed to prepare, clean, and normalize JPEG images before publishing or archiving.
Project description
img-sanitizer
Python library designed to sanitize images by removing sensitive metadata.
Features
- CLI tool to scan and sanitize images.
- Generates simple reports about findings.
- Designed to be used in scripts or as a developer tool.
Installation
Install from PyPI with:
pip install img-sanitizer
Or install from source in an editable virtual environment:
git clone https://github.com/6C656C65/img-sanitizer.git
cd img-sanitizer
python -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
After installation the CLI command is img-sanitizer.
Sanitize a source directory (or files) and write sanitized images to a destination directory:
img-sanitizer sanitize SOURCE DESTINATION --worker 4
SOURCE: a directory containing images (or a file path).DESTINATION: directory where sanitized images will be written.--worker: number of worker threads (default: 4).
Global flags:
--debug: enable debug logging for more verbose output (global).
Other commands:
img-sanitizer version: print the installed package version.
Check --help for subcommand and flag details:
img-sanitizer --help
img-sanitizer sanitize --help
How it works
The project provides a small Python package (img_sanitizer) with a CLI entrypoint.
sanitizer.pycontains the core logic to inspect and sanitize image files.report.pybuilds a human-readable report from the sanitizer's findings.cli.pywires the command-line interface to the sanitizer and report generators.
Typical processing flow:
- CLI parses command-line arguments and file paths.
- The sanitizer opens each image, inspects metadata and content heuristics.
- Any sensitive items are removed (when requested) or recorded in a report.
- The report is printed to stdout or written to a file.
The tool is intentionally small and focused; it does not try to be a comprehensive forensic solution.
Testing
The project includes unit tests (in the tests/ directory). Run them with pytest:
pytest -q
Contributing
Contributions are welcome. Please open issues for bugs or feature requests and submit PRs with tests.
License
See the repository LICENSE for license details.# img-sanitizer
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 img_sanitizer-0.1.3.tar.gz.
File metadata
- Download URL: img_sanitizer-0.1.3.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22c498799f881b7ec21793658aef2c4df5c10e3841d21cda81f6123c83ebfbe0
|
|
| MD5 |
17baa6be0217fb0eb6f0498557be1cc6
|
|
| BLAKE2b-256 |
4c42a97d613ad89874cbdaf67b64d97833c5be3d4e906f95d0447427af1c4636
|
Provenance
The following attestation bundles were made for img_sanitizer-0.1.3.tar.gz:
Publisher:
main.yml on 6C656C65/img-sanitizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
img_sanitizer-0.1.3.tar.gz -
Subject digest:
22c498799f881b7ec21793658aef2c4df5c10e3841d21cda81f6123c83ebfbe0 - Sigstore transparency entry: 911932855
- Sigstore integration time:
-
Permalink:
6C656C65/img-sanitizer@daac6596bad11d2d559b5bab2894fb95c8bb5c19 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/6C656C65
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@daac6596bad11d2d559b5bab2894fb95c8bb5c19 -
Trigger Event:
push
-
Statement type:
File details
Details for the file img_sanitizer-0.1.3-py3-none-any.whl.
File metadata
- Download URL: img_sanitizer-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f0be530d1fdf17a4d5a88f49dd2ebc781d1827893de00721c5813637c336e78
|
|
| MD5 |
0f2cde240dc7c30e2ca359d89413eae4
|
|
| BLAKE2b-256 |
e244d383cdc54b5d4fa8d629d0db696963b3b2a9e97160968e7513131bb4e0d6
|
Provenance
The following attestation bundles were made for img_sanitizer-0.1.3-py3-none-any.whl:
Publisher:
main.yml on 6C656C65/img-sanitizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
img_sanitizer-0.1.3-py3-none-any.whl -
Subject digest:
4f0be530d1fdf17a4d5a88f49dd2ebc781d1827893de00721c5813637c336e78 - Sigstore transparency entry: 911932923
- Sigstore integration time:
-
Permalink:
6C656C65/img-sanitizer@daac6596bad11d2d559b5bab2894fb95c8bb5c19 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/6C656C65
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@daac6596bad11d2d559b5bab2894fb95c8bb5c19 -
Trigger Event:
push
-
Statement type: