-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(account): add support for PNG avatars #10506
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
base: main
Are you sure you want to change the base?
Conversation
Removed commented-out code and unnecessary notes in the test.
wmontwe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank your for adding support for PNG avatars!
You also need to patch the UpdateAvatarImage use case as it checks the mime type and rejects non JPEG files. Additionally I would change the imagePicker to use OpenDocument to allow you to define a list of allowed file types.
...ain/kotlin/net/thunderbird/feature/account/settings/impl/ui/general/GeneralSettingsScreen.kt
Outdated
Show resolved
Hide resolved
|
Thanks! Maybe I completely forgot about that. It should work now with |
Description
This PR updates the account avatar logic to support both
.jpgand.pngfile extensions. Previously, all avatars were forced to use the.jpgextension, which caused issues when someone uploaded PNGs, especially those with transparency (I tried some for my main email and did not understand why it failed at first, or rather did not show the images in the picker).Changes:
Dynamic extension:
LocalAvatarImageDataSourcenow detects if the source image is a PNG and saves it with the correct.pngextension.delete()function now checks for and removes both.jpgand.pngfiles for the given account. This ensures that, when a user switches from a JPEG avatar to a PNG avatar (or vice versa), the old file is deleted and does not remain orphaned.LocalAvatarImageDataSourceTestto verify PNG support and ensure the clean-up logic works for multiple file types.Fixes:
#10501