# Adding a photo from the chat: `!add_photo` How a member of an album's group puts a photo into it by sending one, and what keeps that path from leaking anything. The album itself — where it lives, what its manifests look like, how several albums coexist — is `DOCS-photo-pack.md`. Send a photo captioned `!add_photo alfa wakacje2019` in one of the album's groups. `alfa` resolves to that person's key; `wakacje2019` matches nobody and is minted as a custom tag. The photo is retrievable through `!alfa` and `!random wakacje2019` **immediately**, with no restart. What holds: - **No typed label travels.** Labels become keys in the registry's `arg_resolver`, at the dispatcher, *before* the line that logs the command name. The reply is counts and pseudonyms — `dodano · p1: 4 · t1: 1`. - **No cap.** No cooldown, no size limit, no daily limit. `!random` takes the ordinary pack cooldown; `!add_photo` takes no decorator at all. - **At most six labels**, the same ceiling `!alfa beta …` has. - **The attachment must be on the same message**, never a quoted one: a reply carries the *quoted* message's media in `quote.attachments`, and taking it would let anyone re-file somebody else's photo. - **A duplicate changes nothing.** The stored name is a content hash, so a photo already in the album is reported and skipped; a mixed batch stores the new files and says how many were already there. - **Nothing is written until it works.** Media, `tags.json`, `custom.json` and `adds.json` are written, the album is reloaded, and only a load that succeeds is published. A load that fails rolls all four back and keeps serving the album that was already working. - **The second copy goes.** signal-cli keeps its own copy of every inbound attachment outside the album's `0700`. `!add_photo` deletes it once the file is stored, and also when the upload was refused. ### Stripping: exiftool, with a positive check `ffmpeg -map_metadata -1 -c copy` was tried first and **fails silently on photos**: given a JPEG with a real APP1 Exif segment it returned a byte-identical file, GPS marker intact, and exited 0. `-c copy` passes the compressed frame through as an opaque packet and a JPEG's Exif lives inside it. Do not reintroduce ffmpeg for this. So the gate is a **positive check on the output**, never an exit code: ```sh exiftool -all= -o # never --overwrite_original on the temp exiftool -G0 -s -all # then read it back ``` and every surviving tag must be **structural**. Measured against exiftool 13.55, the plan's original "the surviving set must be empty" would have rejected every format except JPEG — a valid PNG always reports its IHDR under `PNG`, a GIF its screen descriptor under `GIF`, an MP4 some fifty `QuickTime` tags that *are* the container. So the allowlist is per **tag name** (`signal_bot/media_tags.py`), which keeps the property that matters: an atom nobody anticipated arrives as a name that is not on the list, and the upload is refused. Allowlist, not blocklist, for the reason a naive gate misses: an MP4 geotag is a QuickTime `udta`/`©xyz` atom reported under **`QuickTime`**, not `GPS`. The list includes the **codec's own configuration** — `CompressorName`, `VendorID`, and the HEVC parameter set (`HEVCConfigurationVersion`, `GeneralProfileIDC`, `BitDepthLuma`, …). That was forced by measurement, not chosen for convenience: with them off the list exiftool 13.55 could produce no acceptable video *and* no acceptable HEIC, because `CompressorName` lives in the `avc1` sample description and exiftool reports it as not writable at all (`Sorry, QuickTime:CompressorName doesn't exist or isn't writable`), and a real HEIC reports sixteen HEVC config tags. Since HEIC is the iPhone default, the choice was codec parameters or no phone photos. They describe how the picture is encoded, never where it was taken or who took it; every location and identity tag is still refused, and `scripts/e2e.sh` proves a QuickTime GPS atom does not survive on a file the album actually stored. Formats are decided by **magic bytes**, never by the filename: jpg, png, gif, webp, mp4, mov, m4v, heic, heif, avif, webm and svg. Every one of them must also be in `pack.MEDIA_TYPES`, or a file that uploaded cleanly is refused by the *next* load and takes startup down. ### ⚠️ .webm and .svg are stored unstripped exiftool 13.55 can write neither (`exiftool -listwf` lists no `WEBM` and no `SVG`; a strip attempt returns `Can't write SVG files`). Its SVG *reader* does not surface `` content either, so there is no detection to fall back on. kuhy's decision of 2026-08-31 is to keep both on the allowlist and store them **as they arrive, metadata included**. The consequence, stated plainly: an `.svg` carrying `` or an embedded `` keeps whatever is in it, and every later `!alfa` re-sends that file verbatim. Every other format on the list is stripped and verified.