Skip to main content

Crate snitch

Crate snitch 

Source
Expand description

snitch: read, strip and credit image metadata, and check text for hidden characters.

Three separate jobs that people usually conflate:

snitch      read everything and say plainly what is there
credit      write credit in, and optionally stamp it into the pixels
no-comment  take metadata out

STRIPPING IS SEGMENT SURGERY, NOT RE-ENCODING. Dropping JPEG APPn/COM markers and keeping only the required PNG chunks leaves the decoded pixels byte-identical, and strip::pixels_identical proves it per run rather than asserting it. Re-encoding to “clear” metadata throws away image quality for no reason, and this tool will not do it.

STAMPING DOES re-encode, because it has to: it changes pixels. That is stated at the call site and in the CLI output, because a user deserves to know which operation costs them quality.

HOUSE STYLE. No async, no web framework, no CLI framework, seven direct dependencies, and the two obvious crates for C2PA and MCP were measured and refused. See Cargo.toml for the numbers.

Modules§

c2pa
C2PA Content Credentials: reading, and keeping three different facts apart.
cli
Shared command-line plumbing: colour, argument parsing and the renderers.
exif
The ExifTool bridge, and the one piece of TIFF this tool writes by hand.
inspect
The structured report. The CLI formats it, the MCP server serialises it, and the data lives here so neither of them has to reimplement it.
jpeg
JPEG marker surgery: drop the application segments that carry metadata, keep the ones that decide how the image looks.
mcp
A local stdio MCP server, hand-rolled, with no async runtime.
png
PNG chunk surgery: what to keep, what to drop, and what the text chunks are saying.
sign
C2PA Content Credentials: signing.
stamp
Composite a visible mark into the pixels.
strip
Stripping, the pixel proof that makes the claim honest, and safe output paths.
survival
Sourced claims about what platforms do to image metadata.
text
What is actually in a piece of text.

Constants§

LICENCES
Licence presets, exactly as the Python shipped them.
VERSION

Functions§

licence
licence_keys