Skip to content

feat(preview): backport animated WebP preview updates (#2734) - #2817

Merged
wmfeht merged 1 commit into
strata-nextfrom
feat/2734-backport-animated-webp-previews
Nov 25, 2026
Merged

wmfeht merged 1 commit into
strata-nextfrom
feat/2734-backport-animated-webp-previews

Conversation

@wmfeht

@wmfeht wmfeht commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Backports the remaining deltas from main PR #2734 (56dc379c7) onto strata-next, reconciled with #2758 (da737d310), which already implemented animated WebP playback on strata-next using the pure-Rust sandboxed image::codecs::webp::WebPDecoder (without requiring FFmpeg 9.0's webp_anim demuxer and with remote animated WebP support).

Changes included:

  • LiveChanges timer cleanup (crates/strata-fs/src/app/browser/live_changes.rs): implements Drop for LiveChanges to remove any pending GLib flush timer when a Browser drops, preventing leaked thread-bound timers from firing on another thread iterating the default MainContext, with regression test dropping_a_browser_removes_its_pending_flush.
  • Rune animation routing (crates/strata-app/src/preview/media/mod.rs, tests/media.rs): broadens is_animation to content_type.starts_with("image/") so any image MIME type reaching the media player loops from 0:00 with play/pause only, and verifies that animated WebP and misnamed image animations ignore preview_video_start.
  • Local preview resolution test (crates/strata-fs/src/adapters/local_preview/tests/resolution.rs): adds a misnamed loop.png animated WebP case to PREVIEW_FAMILY_CASES.
  • Documentation (docs/preferences.md, docs/preview-sandbox.md): documents animated WebP behavior under Preview autoplay, Video preview start, and the sandboxed media playback section (accurately describing strata-next's built-in sandboxed WebP decoder).

Visual evidence

N/A: no visual changes beyond existing #2758 animated WebP playback. Selecting an animated WebP (including one with a mismatched extension) opens it in the animation player starting at 0:00 with only a play/pause toggle and continuous looping, while static WebP files keep the still-image viewer.

How to test

  1. Enable Video preview start (for example, 50%) in Settings and open a folder containing a static .webp, an animated .webp, and a copy of the animated WebP renamed to .png.
  2. Select the static .webp and open Quick Preview: it opens in the still image viewer.
  3. Select the animated .webp and the renamed .png copy: both open in the animation player at 0:00 (ignoring the configured video start percentage), show only the play/pause control, and loop continuously.

Related issue

Backports #2734.

Backport the remaining changes from main PR #2734 (56dc379) onto
strata-next, where #2758 already implemented animated WebP playback via
the pure-Rust sandboxed WebP decoder:

- Remove any pending live-change flush timer when LiveChanges drops so
  dropped browsers do not leave thread-bound GLib sources attached to
  the default main context, with regression coverage.
- Broaden the Rune media viewer's animation check to any image/* MIME
  type reaching the media player, and verify animated WebP and misnamed
  image animations ignore preview_video_start and start at 0:00.
- Cover misnamed local animated WebP resolution (loop.png -> Media).
- Document animated WebP behavior in docs/preferences.md and
  docs/preview-sandbox.md for strata-next's built-in sandboxed decoder.
@wmfeht
wmfeht merged commit bf93ba1 into strata-next Nov 25, 2026
13 checks passed
@wmfeht
wmfeht deleted the feat/2734-backport-animated-webp-previews branch November 25, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant