Skip to content

Play animated images in the timeline, decode images at their drawn size - #1133

Merged
kevinaboos merged 2 commits into
project-robius:mainfrom
kevinaboos:animated_images_decode_fix
Oct 8, 2026
Merged

kevinaboos merged 2 commits into
project-robius:mainfrom
kevinaboos:animated_images_decode_fix

Conversation

@kevinaboos

Copy link
Copy Markdown
Member

Animated GIFs, WebP and APNG images (aka "stickers" in matrix) were blank in the timeline, even though we added support for them in Makepad a few months ago. The issues were that we were asking for non-animated thumbnails (so just the first frame), which is often just blank or empty; also, the imageviewer was stretching them.

Now we do the following:

  • Request animated thumbnails of the original file, or fetch the original file in full if the server only has a non-aniamted thumbnail to give us
  • Decode timeline images at the size they're drawn at, rather than their full size, which is way more memory efficient (and also more performant)
    • this also lets us remove the 1MiB size cap
  • Free a timeline's decoded images when the timeline is closed, and same for the imageviewer
  • Clicking an image now always opens (and downloads) the original rather than its thumbnail (but still shows the thumbnail at first)
  • Various makepad improvements to make all of this work, see Image: play animated images correctly, and optionally decode images at the size they're drawn at makepad/makepad#1296
  • Also modify our ruma fork to support the unstable is_animated field on media files, which is an experimental thing that ELement also does

Animated GIFs, WebP and APNG images (aka "stickers" in matrix) were blank
in the timeline, even though we added support for them in Makepad a few months ago.
The issues were that we were asking for non-animated thumbnails (so just the first frame),
which is often just blank or empty; also, the imageviewer was stretching them.

Now we do the following:
* Request animated thumbnails of the original file, or fetch the original file
  in full if the server only has a non-aniamted thumbnail to give us
* Decode timeline images at the size they're drawn at, rather than their full size,
  which is way more memory efficient (and also more performant)
  * this also lets us remove the 1MiB size cap
* Free a timeline's decoded images when the timeline is closed,
  and same for the imageviewer
* Clicking an image now always opens (and downloads) the original
  rather than its thumbnail (but still shows the thumbnail at first)
* Various makepad improvements to make all of this work,
  see makepad/makepad#1296
* Also modify our `ruma` fork to support the unstable `is_animated` field
  on media files, which is an experimental thing that ELement also does
@kevinaboos
kevinaboos merged commit e5cf3a0 into project-robius:main Oct 8, 2026
11 checks passed
@kevinaboos
kevinaboos deleted the animated_images_decode_fix branch October 8, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant