Strip EXIF/GPS metadata from images by default (currently only when compression is on) #109

Open
opened 2026-09-17 13:27:07 -04:00 by jared · 0 comments
Owner

Verified 2026-09-17: metadata is only dropped as a side effect of the opt-in compression path (src/app/utils/imageCompression.ts re-encodes through a canvas, which bakes orientation and discards EXIF). With compression off — the default — the original file is uploaded byte-for-byte, so a phone photo carries its GPS coordinates, device model and timestamp to everyone in the room (and to the homeserver's media store).

Scope

  • Metadata-only strip for JPEG/PNG/WebP/HEIC-as-supported on every image upload path (composer attach, paste, drag-drop, avatar/room avatar, GIF upload excluded): remove EXIF/XMP/IPTC segments without re-encoding pixels, so quality is untouched and the file stays the same format. Apply the EXIF orientation first if the strip would otherwise change how the image displays (rotate via canvas only in that case, or keep the orientation tag alone).
  • Setting under Settings → Privacy: "Remove photo metadata (location, camera) before sending" — default on.
  • Show "metadata removed" in the upload card so users know.
  • Unit tests on fixture files with a GPS EXIF block.

Notes

  • Videos are out of scope for v1 (container metadata needs a demuxer); note it in the tile description.
Verified 2026-09-17: metadata is only dropped as a side effect of the **opt-in** compression path (`src/app/utils/imageCompression.ts` re-encodes through a canvas, which bakes orientation and discards EXIF). With compression off — the default — the original file is uploaded byte-for-byte, so a phone photo carries its GPS coordinates, device model and timestamp to everyone in the room (and to the homeserver's media store). ### Scope - Metadata-only strip for JPEG/PNG/WebP/HEIC-as-supported on every image upload path (composer attach, paste, drag-drop, avatar/room avatar, GIF upload excluded): remove EXIF/XMP/IPTC segments without re-encoding pixels, so quality is untouched and the file stays the same format. Apply the EXIF orientation first if the strip would otherwise change how the image displays (rotate via canvas only in that case, or keep the orientation tag alone). - Setting under Settings → Privacy: "Remove photo metadata (location, camera) before sending" — **default on**. - Show "metadata removed" in the upload card so users know. - Unit tests on fixture files with a GPS EXIF block. ### Notes - Videos are out of scope for v1 (container metadata needs a demuxer); note it in the tile description.
jared added this to the Features 2026-Q4 milestone 2026-09-17 13:27:07 -04:00
jared added the enhancementpriority: highsecurityarea: media labels 2026-09-17 13:27:07 -04:00
jared self-assigned this 2026-09-17 13:27:07 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#109