-
Notifications
You must be signed in to change notification settings - Fork 151
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
Force Discord avatars to be PNGs in a friendly matter #792
base: develop
Are you sure you want to change the base?
Conversation
WebP thumbnails work, but requires installing an extra library. On Debian, it's If that still works, we can just document that library as an optional dependency & make PNG-only thumbnails a configuration setting. And IIRC Discord sometimes sends image attachments as WebP too, not just avatars. |
Unless there's something new I'm not aware of, image attachments are always send as-is, so it's dependent on what the user sends, not Discord. And thumbnails are just generated via passing Regarding |
Ah, that makes sense. Though that suggests the bridge/homeservers ought to support WebP, lest images fail to be bridged.
It might be that Synapse is what requires the library, not the bridge. That would explain federation issues like what you've described (i.e. any homeserver that doesn't have the library will fail). I'll try to reproduce the problem to refresh my memory on what the actual error is. |
Also worth noting that this issue only occurred "recently". It used to federate them just fine a month or so ago, and then it just suddenly... stopped. Which still makes me question |
Co-Authored-By: Travis Ralston <[email protected]>
Seems like the matrix.org homeserver disabled webp support, which considering it is the biggest homeserver, it cannot be forgiven, so using the patch works |
This can be considered a hack in order to fix #788
It was discussed a bit in
#help:t2bot.io
on what the root cause of the issue might be, and it was found out that the bridge creates webp thumbnails for users on t2bot.io, which then often (not always for some reason) aren't mirrored to matrix.org (and potentially other HS), causing Clients to just display a default/broken avatar.This PR circumvents the root cause, by just forcing all avatars to be in PNG format, as then thumbnails get mirrored correctly.
Only users who update their avatar will create revalidation. This is done in order to not revalidate every user currently existing on the bridge which would cause quite a bit of network traffic.
An alternative solution would be to implement #743; have a config file with a wished image file format, which is then used for checking the discord profile picture. I however am not that proficient with JS nor can I self-host/test my changes, hence this primitive solution.
Even better would be to figure out why the thumbnails aren't generates/mirrored in the first place. Possibly is related to #770, but not sure.
Either way, I'm opening this PR so that people who are self-hosting and are encountering the issue have a solution they can apply until the underlying root causes can be found and properly fixed.