Chat: inline image previews (web image links + SL textures) #265

Closed
opened 2026-10-03 07:00:22 +00:00 by sky_line · 1 comment
Owner

Show images inline in nearby chat, IMs and group chat.

Background

SL chat carries text only, so "embedding" means recognising image references in messages and rendering a preview inline. The sender's experience is unchanged; viewers that don't support this just show the link.

Sources to support

  1. Web image URLs (https://…/x.png|jpg|webp|gif, plus common hosts such as Discord CDN, Imgur and Gyazo): fetch, decode, show a thumbnail.
  2. SL textures: texture UUIDs and secondlife:///app/… texture/inventory links. Render through the normal texture fetch (respecting permissions; full-perm or shared textures only).
  3. Optional, sending side: drag a texture or snapshot into the chat bar. It inserts a link (an uploaded texture UUID or a web link); nothing binary is sent.

UX

  • A thumbnail below the message line (max height ~128-200 px, scaled down), click to open full size in a preview floater, right-click to copy the link or save.
  • Animated GIF/WebP: first frame by default, animate on hover (optional).
  • Per-conversation and global toggles; collapse previews in busy nearby chat.

Privacy and safety (important)

  • Auto-loading a URL leaks the viewer's IP to whoever posted it. Default: click to load for web images, with an optional allow-list of trusted hosts, or "load from friends".
  • Size and dimension caps (e.g. ≤ 10 MB, ≤ 4096²), content-type check, decode off the main thread, no SVG or other script-capable formats, timeouts. Treat everything as untrusted (cf. the security audit's decoder hardening).
  • Never fetch file: or local/LAN addresses (block RFC1918 / loopback hosts).
  • Respect mute (no previews from muted people) and RLV restrictions.
  • No previews for links inside <nolink> or from scripts unless enabled.

Implementation notes

  • Hook into LLTextBase link detection (LLUrlRegistry / LLUrlEntryHTTP). An inline image segment type in the chat history (LLChatHistory / FSChatHistory equivalents) with a deferred height.
  • Web fetch via llcorehttp (the TLS hardening applies); decode with the existing image decoders (PNG/JPEG/WebP present) into an LLViewerTexture or a UI-only image.
  • Retained UI: invalidate the conversation's recording when a preview finishes loading.
  • Cache thumbnails per URL (bounded LRU, memory budget; see the memory-management rule).
Show images inline in nearby chat, IMs and group chat. ## Background SL chat carries text only, so "embedding" means **recognising image references in messages and rendering a preview inline**. The sender's experience is unchanged; viewers that don't support this just show the link. ## Sources to support 1. **Web image URLs** (`https://…/x.png|jpg|webp|gif`, plus common hosts such as Discord CDN, Imgur and Gyazo): fetch, decode, show a thumbnail. 2. **SL textures**: texture UUIDs and `secondlife:///app/…` texture/inventory links. Render through the normal texture fetch (respecting permissions; full-perm or shared textures only). 3. **Optional, sending side:** drag a texture or snapshot into the chat bar. It inserts a link (an uploaded texture UUID or a web link); nothing binary is sent. ## UX - A thumbnail below the message line (max height ~128-200 px, scaled down), click to open full size in a preview floater, right-click to copy the link or save. - Animated GIF/WebP: first frame by default, animate on hover (optional). - Per-conversation and global toggles; collapse previews in busy nearby chat. ## Privacy and safety (important) - **Auto-loading a URL leaks the viewer's IP** to whoever posted it. Default: **click to load** for web images, with an optional allow-list of trusted hosts, or "load from friends". - Size and dimension caps (e.g. ≤ 10 MB, ≤ 4096²), content-type check, decode off the main thread, no SVG or other script-capable formats, timeouts. Treat everything as untrusted (cf. the security audit's decoder hardening). - Never fetch `file:` or local/LAN addresses (block RFC1918 / loopback hosts). - Respect mute (no previews from muted people) and RLV restrictions. - No previews for links inside `<nolink>` or from scripts unless enabled. ## Implementation notes - Hook into `LLTextBase` link detection (`LLUrlRegistry` / `LLUrlEntryHTTP`). An inline image segment type in the chat history (`LLChatHistory` / `FSChatHistory` equivalents) with a deferred height. - Web fetch via llcorehttp (the TLS hardening applies); decode with the existing image decoders (PNG/JPEG/WebP present) into an LLViewerTexture or a UI-only image. - Retained UI: invalidate the conversation's recording when a preview finishes loading. - Cache thumbnails per URL (bounded LRU, memory budget; see the memory-management rule).
sky_line added this to the 1.1.0 milestone 2026-10-05 17:02:31 +00:00
sky_line added this to the Slipstream project 2026-10-06 15:04:13 +00:00
Author
Owner

Shipped in a published release and tested; closing (testing-lane sweep 2026-10-11).

Shipped in a published release and tested; closing (testing-lane sweep 2026-10-11).
sky_line 2026-10-11 13:24:52 +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#265
No description provided.