Uploading a private photo or unreleased AI asset to a remote server just to check whether it leaks GPS coordinates defeats the point of privacy hygiene. Traditional server-side metadata tools commonly retain uploads for 24 to 72 hours while running backend binaries. On the other hand, scrubbing EXIF tags by drawing onto an HTML5 <canvas> introduces JPEG recompression artifacts, alters PNG compression, drops wide-gamut ICC profiles, or flattens animated WebP frames.
We built a 100% browser-local image metadata inspector and lossless binary stripper in pure ESM JavaScript that operates directly on Uint8Array container bytes with zero network uploads:
- Live zero-upload tool: Apps66 Image Metadata Inspector (unlimited free JPEG/PNG/WebP inspection, Privacy Risk Grading, single-file Markdown/JSON audit copy, and lossless stripping up to 5 images per batch without signup; Apps66 Pro unlocks unlimited bulk batches, 1-click
.ZIPdownload, and multi-file CSV/JSON audit reports) - Open-source MIT engine & CLI: PeakProductivity/image-metadata-inspector-core
- Full engineering reference: Hidden Metadata in JPEG, PNG, and WebP: EXIF GPS, ComfyUI Prompts, and C2PA Markers Explained (2026)
1. Where Images Hide Metadata (JPEG, PNG, and WebP Map)
Parsing and cleaning containers at the byte level keeps compressed pixel streams intact while discarding only metadata segments and chunks:
| Format | Magic Bytes | Metadata Containers Parsed | Lossless Binary Stripper Behavior |
|---|---|---|---|
| JPEG | FF D8 | APP1 (Exif\0\0 IFDs, XMP XML), APP2 (multi-chunk ICC_PROFILE), APP11 (JUMBF/C2PA), APP13 (8BIM IPTC), COM | Drops APP1..APP15 and COM while preserving stuffed FF 00 entropy scans and restart markers; optional preserveIcc keeps APP2 ICC chunks |
| PNG | 89 50 4E 47 0D 0A 1A 0A | tEXt, zTXt (zlib), iTXt (UTF-8 / zlib), eXIf, iCCP, pHYs, tIME, caBX (C2PA JUMBF) | Keeps strictly IHDR, PLTE, tRNS, IDAT, IEND (plus optional iCCP/sRGB/gAMA) and recalculates IEEE 802.3 CRC32 (0xedb88320) |
| WebP | RIFF....WEBP | VP8X bitmasks (0x40 ICC, 0x20 Alpha, 0x10 EXIF, 0x08 XMP, 0x04 ANIM), EXIF, XMP, ICCP, C2PA, JUMB | Drops EXIF, XMP, C2PA, JUMB (and ICCP unless kept), clears VP8X flags, keeps RIFF odd-byte padding, and updates RIFF size |
2. Decoding EXIF GPS, Multi-Chunk ICC, and ComfyUI / A1111 Prompts
EXIF uses identical TIFF IFD layouts across JPEG APP1, PNG eXIf, and WebP EXIF. Checking the II (0x4949) or MM (0x4d4d) byte-order marker and walking IFD0, ExifIFD (0x8769), and GPS IFD (0x8825) with cycle protection surfaces camera serial numbers (BodySerialNumber, LensSerialNumber), UserComment text, and rational DMS GPS coordinates (degrees + minutes / 60 + seconds / 3600, negated for S/W refs and below-sea-level altitude).
AI image generators rarely use standard EXIF tags; instead they serialize prompts into PNG text chunks:
- Pure-JS zlib inflation: PNG
zTXtchunks and compressediTXtchunks (compFlag === 1) use RFC 1950/1951 Deflate streams. To stay dependency-free across browser and Node runtimes, the library embeds a synchronousinflateZlib()decoder handling stored blocks, fixed Huffman tables, and dynamic Huffman trees with a 16 MB guard. - ComfyUI (
prompt&workflow): Parses JSON node maps checkingclass_typeto collect model/LoRA/VAE filenames (ckpt_name,unet_name,model_name,lora_name,vae_name),KSamplerparameters (seed,steps,cfg,sampler_name,scheduler), CLIP prompt strings, and graph node/link counts. - Stable Diffusion / A1111, NovelAI & Midjourney: Splits A1111
parameters(and EXIFUserComment) onNegative prompt:andSteps:, extracts NovelAISoftware+ JSONCommentmetadata, and catches MidjourneyDescriptionflags (--ar,--v) plusJob ID:.
import { inspectImageMetadata, stripImageMetadata, auditToMarkdown, auditToCsv, } from 'image-metadata-inspector-core'; // 1. Inspect JPEG, PNG, or WebP bytes completely in-memory const audit = inspectImageMetadata(uint8Bytes, 'studio-render.png'); console.log({ riskGrade: audit.riskGrade, gps: audit.gps, aiGenerators: audit.aiMetadata.generators, comfyModels: audit.aiMetadata.comfyUi?.models || [], c2paDetected: audit.c2pa.detected, }); // 2. Losslessly drop EXIF, GPS, XMP, AI chunks, and C2PA while preserving ICC color profile const cleaned = stripImageMetadata(uint8Bytes, { preserveIcc: true }); // 3. Export pipe-escaped Markdown or formula-safe RFC 4180 CSV const mdReport = auditToMarkdown([audit]); const csvReport = auditToCsv([audit]); You can also run audits or clean directories from the terminal using the bundled zero-dependency CLI:
npx image-metadata-inspector inspect photo.jpg render.png --json npx image-metadata-inspector strip photo.jpg photo.clean.jpg npx image-metadata-inspector strip render.png render.strict.png --drop-icc 3. Lossless Container Invariants & Formula-Safe Audit Exports
Rewriting binary images safely requires three strict checks:
- JPEG progressive scan safety: At
SOS(0xDA),findEntropyScanEnd()advances across byte-stuffedFF 00pairs and restart markers (FF D0..FF D7) so progressive multi-scan JPEGs survive intact while trailing post-EOIbytes are stripped. - PNG IEEE CRC32 recomputation: Stripping chunks requires an allowlist (
IHDR,PLTE,tRNS,IDAT,IEND, plus optional color chunks) and recalculating each chunk's 4-byteCRC32over[type + data]. - WebP odd-byte RIFF padding & VP8X cleanup: Odd-length RIFF payloads require a trailing zero pad byte, and removing
EXIForXMPmust clear bits0x10and0x08inVP8X(collapsingVP8Xentirely back to RFC 9649 Simple WebP when noICC,Alpha, orAnimationflags remain).
Finally, metadata fields inside third-party files are untrusted strings. Opening unescaped dc:creator values or filenames like =HYPERLINK(...) in Excel risks CSV formula injection. auditToCsv() neutralizes any value starting with =, +, -, @, \t, or \r (including after leading whitespace) with a leading single quote before RFC 4180 quoting.
4. Factual C2PA, GDPR, and SynthID Boundaries
- Risk grading & GDPR minimization:
gradePrivacyRisk()flags GPS coordinates, creator/device serial PII, ComfyUI/SD prompt leaks, and C2PA markers asHIGH, camera/software/timestamps asMEDIUM, and clean containers (including ICC-only images) asCLEAN. Client-side processing ensures sensitive coordinates never touch remote infrastructure. - Container presence vs. cryptographic trust: Scanning
APP11,caBX, WebPC2PA/JUMB, and XMP detects JUMBF containers and claim hints (c2pa.claim,trainedAlgorithmicMedia), not X.509/COSE trust signature verification. - Metadata vs. invisible pixel watermarks: Binary container stripping never alters pixel values, so it does not remove invisible pixel-level watermarks such as Google SynthID, and removing metadata does not exempt publishers from applicable AI disclosure requirements.
Try the Workbench or Clone the MIT Core
- 100% browser-local tool: https://apps66.com/image-metadata-inspector
- MIT library & CLI: https://github.com/PeakProductivity/image-metadata-inspector-core
- Full engineering guide: https://apps66.com/blog/hidden-image-metadata-exif-gps-comfyui-c2pa-2026
- Sibling zero-upload tools on Apps66: Compress Image to Exact KB, PNG to SVG Vectorizer, Compare PDF Visual Diff, and Sprite Sheet Slicer & Texture Atlas Inspector

