Add support for displaying gzipped lottie (e.g. tgs)#1104
Conversation
88c48c2 to
c2ee781
Compare
|
Yes, please do. It looks like those lint and merge errors are just a slightly messed up merge in Bookmarks.tsx with some duplicate lines |
88370f8 to
439186a
Compare
|
After the merge, some animated stickers no longer work (those with It asks the homeserver to scale stickers, but the server can't scale Lottie. We can see that in the logs: What should we do? Should we fallback to the original download url when thumbnail is not available? @7w1 This is fixed when I change the line to: return mxcUrlToHttp(mx, url, useAuthentication) ?? undefined;Why do we use a thumbnail when displaying stickers in room, but the full image in the sticker picker? |
|
You're right, it probably shouldn't have been changed there. I changed it in #1286 so if you merge/rebase on the latest it should finally work |
439186a to
e5580d6
Compare
|
Thanks. It's fixed now. @7w1 |
|
Hey, I'm doing some cleanup on your pr and it'll be merged at some point. There's a few issues I still need to fix, namely better mime type classification, some form of max size, and just testing coverage and making sure normal media isn't broken. |
|
Hi, after your changes, animated stickers with Please test your changes by sending an My code wasn’t sensitive to the mimetype, although I use |
|
I’ll fix that tomorrow (or you’re welcome to). We can just add that detection as a fallback for when the normal image tags fail to load. I wanted to prefer using mime types when possible just because it’s a nonstandard image type. |
Description
Hi,
This PR adds support for displaying gzipped Lottie files, such as
.tgs(Telegram sticker) files.Demo video:

How it works
Gzipped files begin with a fixed byte sequence (
1f 8b), which distinguishes them from standard image formats (PNG, WebP, JPG). The implementation detects this signature in the file header and automatically decompresses gzipped content before parsing it as Lottie JSON. If parsing succeeds, the decompressed animation is passed to the Lottie player.To test this feature, download and unzip AnimatedSticker.tgs.zip, then send it as
m.imageorm.sticker.What I have tested
m.image,m.sticker, and inline emoji on Chromem.imageandm.stickeron SafariNext steps
autoplayStickerssetting when rendering stickers (setautoplay={false}in DotLottieReact)autoplayEmojissetting when rendering emojis (setautoplay={false}in DotLottieReact)Type of change
Checklist:
AI disclosure: