stickerpicker icon indicating copy to clipboard operation
stickerpicker copied to clipboard

Added animated telegram sticker support for sticker-import

Open dzoidbrg opened this issue 1 year ago • 32 comments

Commit message is self explanatory. I have tested this and according to some users in the matrix channel, it works.

dzoidbrg avatar Aug 20 '23 20:08 dzoidbrg

this is currently already supported by LuckyTurtleDev/mstickereditor

LuckyTurtleDev avatar Aug 25 '23 18:08 LuckyTurtleDev

I just recently saw your program after submitting this pull request but I thought it would be easier or more convenient for some users to use the Python script directly.

dzoidbrg avatar Aug 26 '23 07:08 dzoidbrg

And for many users, like me, the functionality of the program you created is not needed.

dzoidbrg avatar Aug 26 '23 07:08 dzoidbrg

But I do think that for some users, your program is more useful.

dzoidbrg avatar Aug 26 '23 07:08 dzoidbrg

Would using webp instead of gif not be the better choice? Gif does not support semitransparent pixel, which leads to ugly effects, if the background of the client does not match the color used for semitransparent background.

Also webp is now widely supported by matirx clients:

Client gif webp stickerpicker type
Cinny ponies
Element Desktop/Web widget
Element Android no autoplay widget
FluffyChat ponies
Nheko ponies
Schildi Desktop/Web widget
Schildi Android widget
mautrix-telegram-bridge static image only -

LuckyTurtleDev avatar Aug 26 '23 10:08 LuckyTurtleDev

Thanks for your input, I will move over to webp

dzoidbrg avatar Aug 26 '23 12:08 dzoidbrg

However I am not sure how active this project is. There are some pr that have been open for over a year and have zero comments.

LuckyTurtleDev avatar Aug 26 '23 13:08 LuckyTurtleDev

@LuckyTurtleDev @dzoidbrg

It appears that both of your repositories lack the support for win32/windows, I tried using @dzoidbrg's code since it looks to need less dependencies but I don't think there is a win32 build of lottieconverter or if lottieconverter's source code can be compiled in win32 or not.

It'd be really cool if you could add win32 support.

0x416c69 avatar Sep 04 '23 09:09 0x416c69

@0x416c69 The problem is that i have no experience with linking c libs on windows. I am not sure if the rlottie crate does even support compiling on windows. Probably @msrd0 knows more. But everything else should be possible to build and run on windows too. So if some would provide build instruction or would build it at the ci, pr would be welcome.

However I am currently adding feature flags https://github.com/LuckyTurtleDev/mstickereditor/pull/36, so some functionality can be disable, to reduce the count of needed dependencies.

LuckyTurtleDev avatar Sep 04 '23 10:09 LuckyTurtleDev

I have 0 idea about how windows and linking on windows works. The rlottie Rust bindings expect that pkg-config can be used to find rlottie. I have no idea if that works on windows. It might be easiest to use Windows subsystem for Linux, as mstickereditor is a command-line application anyways.

msrd0 avatar Sep 04 '23 10:09 msrd0

@msrd0 both crates (rlottie and rlottie-sys) claim to be platform independent

A platform independent standalone library that plays Lottie Animation

LuckyTurtleDev avatar Sep 04 '23 10:09 LuckyTurtleDev

Oh that's just the description of the rlottie C library xD

But it should work an Linux, Android, MacOS, ... basically everywhere rlottie compiles and pkg-conf works

msrd0 avatar Sep 04 '23 10:09 msrd0

I am well versed in c/cpp, but I haven't tried using rust or its package managers.

I think I'm better off using WSL for this, isn't there a better alternative to maunium's stickerpicker? I was previously using Dimension which is now discontinued.

0x416c69 avatar Sep 04 '23 10:09 0x416c69

I think I'm better off using WSL for this

Yeah it'd take someone with windows and some knowledge with c and rust to make rlottie-rs work on Windows. I haven't used Windows in the last 8 years or so so I can't even test whether it works.

Also thought I'd mention https://github.com/msrd0/tg2mx_bot for ppl that have a linux server and use MSC2545 supporting clients (fluffy, nheko, cinny, etc). I plan on eventually hosting a version of it for public (but heavily resource limited) usage, but I haven't gotten around to it yet. It should also be possible to add support for maunium's json format to it should someone have the time and need for it.

msrd0 avatar Sep 04 '23 11:09 msrd0

@LuckyTurtleDev gif's dont work for me on Schildi Android

dzoidbrg avatar Sep 04 '23 11:09 dzoidbrg

To be honest, I don't like Python either, so I would rather work getting @LuckyTurtleDev's program working on win32

dzoidbrg avatar Sep 04 '23 11:09 dzoidbrg

@dzoidbrg I have created an issue for this: https://github.com/msrd0/rlottie-rs/issues/43. Let's discuss the Rust part there.

msrd0 avatar Sep 04 '23 11:09 msrd0

@LuckyTurtleDev gif's dont work for me on Schildi Android

Strange the last time I have checkout this, it has works fine.

LuckyTurtleDev avatar Sep 04 '23 11:09 LuckyTurtleDev

Unfortunately I haven't made any changes to the code but I was thinking about creating one. I don't know if it's worth waiting for https://github.com/matrix-org/matrix-spec-proposals/pull/1951 or not, it's been submitted since 2019 which is roughly 4 years ago.

Is it really this hard to get a specification into matrix' specs? What's stopping these people? Can we help them instead?

0x416c69 avatar Sep 04 '23 11:09 0x416c69

A better matrix spec would be the solution

dzoidbrg avatar Sep 04 '23 11:09 dzoidbrg

@0x416c69: I think MSC1951 is dead as MSC2545 is being implemented by a bunch of clients already.

msrd0 avatar Sep 04 '23 11:09 msrd0

It is implemented by nearly everything with the exception of element and element based clients.

LuckyTurtleDev avatar Sep 04 '23 12:09 LuckyTurtleDev

But I do not like this MSCs because the allows only one personal sticker pack. Also I do not expect them to be decided in the near future.

LuckyTurtleDev avatar Sep 04 '23 12:09 LuckyTurtleDev

A better matrix spec would be the solution

Which might require a ton of work to maintain it, I don't know if that's viable or not 😄

@0x416c69: I think MSC1951 is dead as MSC2545 is being implemented by a bunch of clients already.

It is implemented by nearly everything with the exception of element and element based clients.

Exactly, it's not supported by Element and we mainly use Element since it's maintained by the OG guys, there seems to be a conflict between whether using that spec or this one with the riot team, I really liked FluffyChat's implementation but Fluffy is unavailable in win32.

0x416c69 avatar Sep 04 '23 12:09 0x416c69

But I do not like this MSCs because the allows only one personal sticker pack.

Yes but I don't think that (a) changing it now would make much sense, as that just further delays getting merged, and (b) not that big of a deal, as you can just create a room with yourself being the only member (which your client could also do and hide from you entirely) where you add all the sticker packs you're interested in. Telegram bdw does not have any notion of user account sticker packs, all sticker packs are "global", so it's really not a big deal. By now we probably already have a few hundred versions of the same commonly used telegram sticker packs as every user individually uploads them to matrix xD.

msrd0 avatar Sep 04 '23 12:09 msrd0

I mean, this I will leave to the matrix wizards. I will try getting rlottie working on windows and making @LuckyTurtleDev's code work with Win32. I think that this is better than my hacked python script. I will still try to get it merged because for simple use cases, python is way more portable.

dzoidbrg avatar Sep 04 '23 12:09 dzoidbrg

@dzoidbrg the only this which block mstickereditor to be run on windows should be the rlottie crate. So if the crate works on win an update of the dependencies should make mstickereditor also win compatible.

LuckyTurtleDev avatar Sep 04 '23 13:09 LuckyTurtleDev

I will try working on the rlottie crate.

dzoidbrg avatar Sep 04 '23 13:09 dzoidbrg

Should we close this? I think the main work has to be done on rlottie, and their is a PR relating to that.

dzoidbrg avatar Sep 04 '23 16:09 dzoidbrg

Git version of mstickereditor does now support win with lottie feature-flag disable. So only video and static features are support on win for now.

LuckyTurtleDev avatar Sep 05 '23 19:09 LuckyTurtleDev