-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telegram: animated stickers #874
Comments
Sure, do you know a library that can do that? |
No and we'll have to wait until this will be in the open source Telegram version. |
The only tool that could do something like this (right now) is the python package TGS. It could convert those files into video or GIFs. |
There is the python library lottie, and after a single
Which results in a webp file (and GitHub can't deal with WebP yet). Can this plus tengo do this? I hope that the image is already somewhere on the filesystem, in which case Tengo would need to intercept the outgoing message, call Is there anyone here who knows tengo well enough? |
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for 42wim#874 This patch introduces two new config flags: - MediaConvertTgsToWebP - MediaConvertTgsToPNG These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. I will propose new text for the Wiki in the PR for this patch. (Should be 42wim#1173 or so.)
This is half a fix for #874 This patch introduces a new config flag: - MediaConvertTgs These need to be treated independently from the existing MediaConvertWebPToPNG flag because Tgs→WebP results in an *animated* WebP, and the WebP→PNG converter can't handle animated WebP files yet. Furthermore, some platforms (like discord) don't even support animated WebP files, so the user may want to fall back to static PNGs (not APNGs). The final reason why this is only half a fix is that this introduces an external dependency, namely lottie, to be installed like this: $ pip3 install lottie cairosvg This patch works by writing the tgs to a temporary file in /tmp, calling lottie to convert it (this conversion may take several seconds!), and then deleting the temporary file. The temporary file is absolutely necessary, as lottie refuses to work on non-seekable files. If anyone comes up with a reasonable use case where /tmp is unavailable, I can add yet another config option for that, if desired. Telegram will bail out if the option is configured but lottie isn't found.
Fixed in #1173 |
@BenWiederhake I did exactly what you said but, it doesn't find the And when I run the command directly from the downloaded release: |
Well, yes, as you observed correctly, it has to be actually installed. |
@BenWiederhake My bad. After installed https://pillow.readthedocs.io/en/stable/installation.html, it worked But, the result wasn't good enough. I've tested this sticker to JSON: |
Well, yes, as you observed correctly, lottie has bugs. If you improve lottie, I'll buy you a drink. |
this was buried and wanted to bring it up in the config Convert Tgs (Telegram animated sticker) images to PNG before upload. This is useful when your bridge also contains platforms that do not support animated WebP files, like Discord. This requires the external dependency `lottie`, which can be installed like this: `pip install lottie cairosvg` #874 #1173
Telegram introduced animated stickers in TGS format. They don't get converted to PNG. And the browsers can't show them either. Maybe convert them to APNG?
The text was updated successfully, but these errors were encountered: