mstickereditor icon indicating copy to clipboard operation
mstickereditor copied to clipboard

Enable Support for webp Stickers in iOS Element App and Automate Thumbnail Conversion to GIF

Open cksit opened this issue 1 year ago • 2 comments

Unfortunately, the current iOS Element app does not support webp stickers.

After testing, I have successfully enabled animated stickers in the iOS Element app. Below is an example sticker format:

        {
            "body": "🔫",
            "url": "mxc://<my-home-server>/bmNWFYcyvThrPsgAHsMaFJBL",
            "info": {
                "w": 512,
                "h": 512,
                "size": 82887,
                "mimetype": "image/gif",
                "thumbnail_url": "mxc://<my-home-server>/bmNWFYcyvThrPsgAHsMaFJBL",
                "thumbnail_info": {
                    "w": 128,
                    "h": 128,
                    "size": 2580,
                    "mimetype": "image/gif"
                }
            },
            "msgtype": "m.sticker",
            "id": "mxc://<my-home-server>/bmNWFYcyvThrPsgAHsMaFJBL",
            "net.maunium.telegram.sticker": null
        },

During testing, I found that both the sticker and its thumbnail must have the mimetype set to image/gif. However, since the uploaded thumbnail is in webp format, I've utilized the sticker URL as the thumbnail URL, which has proven to work flawlessly.

I'm now considering if there's a more automated approach to this issue, such as converting the thumbnail into a GIF format and uploading it to the Synapse Matrix server. Any insights on this matter would be greatly appreciated.

cksit avatar Apr 18 '24 14:04 cksit

yes see: https://github.com/LuckyTurtleDev/mstickereditor?tab=readme-ov-file#configuration

make sure to use version v0.3.6 or newer because of issue #50.

LuckyTurtleDev avatar Apr 18 '24 16:04 LuckyTurtleDev

Sorry, forgot to mentioned that I created that PR to fix the Gif animation_format issue. However, as I mentioned, it only convert the tgs file to gif. The thumbnail file from Telegram are in webp format which are not converted. So is there any workaround to convert those thumbnail as well?

cksit avatar Apr 19 '24 13:04 cksit