OpenDeck icon indicating copy to clipboard operation
OpenDeck copied to clipboard

feat: Add reliable animated image support for both the configuration UI and physical device output

Open flagadajones opened this issue 8 months ago • 4 comments

…g logic

Preflight checklist

  • [X ] I understand that if this pull request is about support for non-Elgato or non-Tacto hardware, it will be closed without explanation, as per issue #38.
  • [X ] I have ensured that I have run the appropriate formatter on my changes and that my code produces no linter violations.
  • [X ] I have thoroughly reviewed the diff of my changes and ensured that I have neither introduced any unrelated additions, nor differences in unmodified code.
  • [X ] I will keep "Allow edits from maintainers" enabled for this pull request.

Goal

Add reliable animated image support for both the configuration UI and physical device output, while hardening the rendering pipeline.

Main Changes

  • Enabled gif and webp decoding support in the Rust backend (image crate features).
  • Preserved animated uploads (avoids flattening animated files into a single static frame).
  • Reworked frontend rendering:
    • Frame-by-frame decoding via ImageDecoder (WebCodecs) when available.
    • Time-driven animation loop that respects per-frame durations.
    • Shared global animation clock to keep all animated keys on the same page synchronized.
  • Improved device update path:
    • Dedicated throttled device rendering/send flow.
    • Backpressure to prevent overlapping frame sends and reduce flip/flop artifacts.
    • Separate canvas for device output to isolate UI rendering from hardware updates.
  • Lifecycle cleanup improvements:
    • Explicit animation cleanup on rerender/state changes/component destroy.
  • Updated editor preview handling to match the new renderer return type.

Expected Outcome

  • Animated GIF/WebP files render correctly in the configuration UI.
  • More stable and consistent animation behavior on hardware.
  • Animations on the same page stay synchronized.
  • Fewer visual artifacts caused by update burst/ordering issues.

Impact

  • 5 files changed

Validation

  • deno task check ✅
  • deno lint ✅

flagadajones avatar Apr 01 '26 19:04 flagadajones

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 01 '26 19:04 CLAassistant

Please could you check the compliance of this pull request with the Jellyfin LLM/"AI" Development Policy, recently adopted by the OpenDeck project?

nekename avatar May 22 '26 17:05 nekename

J'ai utilisé un LLM (Claude Sonnet) pour m'aider dans la réalisation de cette gestion des animations, mais j'ai validé l'entièreté du code pour garantir que la synchronisation soit bonne dans le rendu des frame des images animées. Le texte de la PR a été écrit par mes soins mais traduite en anglais par Claude. ce commentaire est traduit par google translate

I used an LLM (Claude Sonnet) to help me with this animation management, but I validated the entire code to ensure proper synchronization in the rendering of animated image frames.

The PR text was written by me but translated into English by Claude.

This comment was translated by Google Translate.

flagadajones avatar Jun 01 '26 21:06 flagadajones

I just tried to run this PR locally, but using an animated GIF as the image still only displays the first frame.

nekename avatar Jun 03 '26 20:06 nekename

I just tried to run this PR locally, but using an animated GIF as the image still only displays the first frame.

Do you have an update on this?

nekename avatar Jun 22 '26 17:06 nekename

Sorry i haven't any time this week. I can check it next week. Can you send me your test conditions ( os, device)? This PR work's fine on my side

flagadajones avatar Jun 22 '26 21:06 flagadajones

I believe it was EndeavourOS with KDE Plasma that I tested it on, but there's a chance it was on macOS as well.

nekename avatar Jun 23 '26 22:06 nekename