Skip to content

Add support for displaying gzipped lottie (e.g. tgs)#1104

Draft
mohsenasm wants to merge 1 commit into
SableClient:devfrom
mohsenasm:gzipped-lottie
Draft

Add support for displaying gzipped lottie (e.g. tgs)#1104
mohsenasm wants to merge 1 commit into
SableClient:devfrom
mohsenasm:gzipped-lottie

Conversation

@mohsenasm

@mohsenasm mohsenasm commented Jul 17, 2026

Copy link
Copy Markdown

Description

Hi,
This PR adds support for displaying gzipped Lottie files, such as .tgs (Telegram sticker) files.

Demo video:
demo

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.image or m.sticker.

What I have tested

  • Works as m.image, m.sticker, and inline emoji on Chrome
  • Works as m.image and m.sticker on Safari
  • Functions correctly in sticker and emoji picker on both browsers

Next steps

  • Fix inline Lottie emoji width on Safari
  • Respect autoplayStickers setting when rendering stickers (set autoplay={false} in DotLottieReact)
  • Respect autoplayEmojis setting when rendering emojis (set autoplay={false} in DotLottieReact)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

@mohsenasm
mohsenasm requested review from 7w1 and hazre as code owners July 17, 2026 12:25
@mohsenasm
mohsenasm marked this pull request as draft July 17, 2026 17:37
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