You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When uploading a custom emoji with transparency in png format, the static version of the emoji will lose transparency info (and actually will turn into black).
Example
Original file at https://example.ltd/fileserver/XXX/emoji/original/XXX.png looks like:
Processed static file at https://example.ltd/fileserver/XXX/emoji/static/XXX.png looks like:
Related code
I have done an experiment that confirms the code in internal/media/png-stripper.go will cause this issue.
However, limited by my ability, I cannot figure out how to fix the bug in that file currently.
And I am curious that, since png file can never be an animated image, why do we need to decode the png file and encode that back like the code below?
But I haven't deeply dived to the whole project yet, so I am not sure if there is something thoughtless in my idea.
It can be an animated image, there are animated pngs :) But yes indeed, losing transparency is a known issue, will have a look soon(tm) how this can be fixed.
It can be an animated image, there are animated pngs :) But yes indeed, losing transparency is a known issue, will have a look soon(tm) how this can be fixed.
I thought PNG and APNG were two totally separated formats both in MIME type and filename extension.
Thank you so much for pointing out my mistake!
Description
When uploading a custom emoji with transparency in png format, the static version of the emoji will lose transparency info (and actually will turn into black).
Example
Original file at
https://example.ltd/fileserver/XXX/emoji/original/XXX.png
looks like:Processed static file at
https://example.ltd/fileserver/XXX/emoji/static/XXX.png
looks like:Related code
I have done an experiment that confirms the code in internal/media/png-stripper.go will cause this issue.
However, limited by my ability, I cannot figure out how to fix the bug in that file currently.
And I am curious that, since png file can never be an animated image, why do we need to decode the png file and encode that back like the code below?
But I haven't deeply dived to the whole project yet, so I am not sure if there is something thoughtless in my idea.
gotosocial/internal/media/image.go
Lines 99 to 125 in 941893a
Related issue(s) & PR(s)
#425
#487
Version
v0.6.0
The text was updated successfully, but these errors were encountered: