Skip to content
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

Added animated telegram sticker support for sticker-import #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dzoidbrg
Copy link

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

@LuckyTurtleDev
Copy link

this is currently already supported by LuckyTurtleDev/mstickereditor

@dzoidbrg
Copy link
Author

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
Copy link
Author

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

@dzoidbrg
Copy link
Author

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

@LuckyTurtleDev
Copy link

LuckyTurtleDev commented Aug 26, 2023

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 -

@dzoidbrg
Copy link
Author

Thanks for your input, I will move over to webp

@LuckyTurtleDev
Copy link

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.

@0x416c69
Copy link

0x416c69 commented Sep 4, 2023

@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.

@LuckyTurtleDev
Copy link

LuckyTurtleDev commented Sep 4, 2023

@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 LuckyTurtleDev/mstickereditor#36, so some functionality can be disable, to reduce the count of needed dependencies.

@msrd0
Copy link

msrd0 commented Sep 4, 2023

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.

@LuckyTurtleDev
Copy link

LuckyTurtleDev commented Sep 4, 2023

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

A platform independent standalone library that plays Lottie Animation

@msrd0
Copy link

msrd0 commented Sep 4, 2023

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

@0x416c69
Copy link

0x416c69 commented Sep 4, 2023

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.

@msrd0
Copy link

msrd0 commented Sep 4, 2023

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.

@dzoidbrg
Copy link
Author

dzoidbrg commented Sep 4, 2023

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

@dzoidbrg
Copy link
Author

dzoidbrg commented Sep 4, 2023

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

@msrd0
Copy link

msrd0 commented Sep 4, 2023

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

@LuckyTurtleDev
Copy link

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

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

@0x416c69
Copy link

0x416c69 commented Sep 4, 2023

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 matrix-org/matrix-spec-proposals#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?

@dzoidbrg
Copy link
Author

dzoidbrg commented Sep 4, 2023

A better matrix spec would be the solution

@msrd0
Copy link

msrd0 commented Sep 4, 2023

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

@LuckyTurtleDev
Copy link

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

@LuckyTurtleDev
Copy link

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.

@0x416c69
Copy link

0x416c69 commented Sep 4, 2023

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.

@msrd0
Copy link

msrd0 commented Sep 4, 2023

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.

@dzoidbrg
Copy link
Author

dzoidbrg commented Sep 4, 2023

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.

@LuckyTurtleDev
Copy link

@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.

@dzoidbrg
Copy link
Author

dzoidbrg commented Sep 4, 2023

I will try working on the rlottie crate.

@dzoidbrg
Copy link
Author

dzoidbrg commented Sep 4, 2023

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

@dzoidbrg dzoidbrg closed this Sep 4, 2023
@dzoidbrg dzoidbrg reopened this Sep 4, 2023
@LuckyTurtleDev
Copy link

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.

@0x416c69
Copy link

0x416c69 commented Sep 6, 2023

@LuckyTurtleDev thank you, I tried it and compiled it but my stickers are not working (?) The media files appear to be there but nothing is showing, not even in Element.
image

https://0x416c69.github.io/stickerpicker/web/#pack-tg_name_MyQuby (latest pack)

My synapse server is up to date. Is it required to enable dynamic_thumbnails in synapse for this to work? When trying to fetch those webp images, I'm getting this error 400:

{"errcode":"M_UNKNOWN","error":"Cannot find any thumbnails for the requested media ([b'ag5.ir', b'qAsAxJsWpWXAlGaJaeZrJwQC']). This might mean the media is not a supported_media_format=(image/jpeg, image/jpg, image/webp, image/gif, image/png) or that thumbnailing failed for some other reason. (Dynamic thumbnails are disabled on this server.)"}

Pack: https://t.me/addstickers/MyQuby

@LuckyTurtleDev
Copy link

@0x416c69 issue moved to LuckyTurtleDev/mstickereditor#38

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.

4 participants