Chat inline image previews: WebP support (still + animated) #651

Closed
opened 2026-10-10 22:33:54 +00:00 by sky_line · 2 comments
Owner

Chat inline image previews (#265) handle PNG, JPEG and GIF (still and animated). WebP links show no preview, even though llchatimagecache.cpp already recognises WebP from its file signature (MAGIC_WEBP). Many image hosts and CDNs now serve WebP by default, so previews are missing for a growing share of links.

Scope

  • Decode still and animated WebP for the inline preview and the full-size preview floater. Animated WebP follows the GIF path: frame timing, loop count and the same frame/memory caps.
  • Accept image/webp from the Content-Type header, the file signature and the .webp extension. Same URL policy as now.
  • Untrusted input. Use a current libwebp release; the 2023 CVE-2023-4863 heap overflow was in libwebp's decoder. Check the dimension and size limits before decoding, as the PNG/JPEG paths do.
  • Build libwebp the same way on Linux, Windows (cross-build) and macOS. Pin it with a hash. Credit it under its BSD licence in the licences/about text.

Optional follow-up, not in this ticket: WebP for texture/snapshot upload and for local image loading.

Chat inline image previews (#265) handle PNG, JPEG and GIF (still and animated). WebP links show no preview, even though `llchatimagecache.cpp` already recognises WebP from its file signature (`MAGIC_WEBP`). Many image hosts and CDNs now serve WebP by default, so previews are missing for a growing share of links. ## Scope - Decode **still and animated** WebP for the inline preview and the full-size preview floater. Animated WebP follows the GIF path: frame timing, loop count and the same frame/memory caps. - Accept `image/webp` from the Content-Type header, the file signature and the `.webp` extension. Same URL policy as now. - **Untrusted input.** Use a current libwebp release; the 2023 CVE-2023-4863 heap overflow was in libwebp's decoder. Check the dimension and size limits *before* decoding, as the PNG/JPEG paths do. - Build libwebp the same way on Linux, Windows (cross-build) and macOS. Pin it with a hash. Credit it under its BSD licence in the licences/about text. Optional follow-up, not in this ticket: WebP for texture/snapshot upload and for local image loading.
sky_line added this to the Slipstream project 2026-10-10 22:33:54 +00:00
Author
Owner

Agent dispatched (Opus: untrusted-input decoding + a new 3p dependency).

Agent dispatched (Opus: untrusted-input decoding + a new 3p dependency).
Author
Owner

Shipped in 1.3.0 Beta 3: still and animated WebP chat previews (libwebp 1.6.0). Confirmed working in-world.

Shipped in **1.3.0 Beta 3**: still and animated WebP chat previews (libwebp 1.6.0). Confirmed working in-world.
sky_line 2026-10-11 08:53:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#651
No description provided.