Skip to content

Request avatars of the appropriate size #301

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

Closed
chrisbobbe opened this issue Sep 7, 2023 · 3 comments · Fixed by #534
Closed

Request avatars of the appropriate size #301

chrisbobbe opened this issue Sep 7, 2023 · 3 comments · Fixed by #534
Assignees
Labels
a-api Implementing specific parts of the Zulip server API beta feedback Things beta users have specifically asked for

Comments

@chrisbobbe
Copy link
Collaborator

With #195 fixed with PR #287, we now have a user-profile screen! 🎉

I noticed that on many profiles on CZO, the avatar is more blurry than on the corresponding screen in zulip-mobile:

zulip-flutter zulip-mobile
image image

This is because we don't yet have special logic for requesting a larger image when we need one. This issue is for adding such logic.

In zulip-mobile, we made an AvatarURL class with a get method that gives you a URL for an image of the specified size in physical pixels (or at least the best possible approximation). AvatarURL has three subclasses that each implement get very differently.

On CZO in #api documentation, I've summarized zulip-mobile's logic for determining a URL for any given size in physical pixels. I'm hoping the API doc can start specifying that logic, and we can use the new documentation for zulip-flutter's implementation.

To convert a logical-pixel value to a physical-pixel value, we'll want to multiply by the device pixel ratio. As in zulip-mobile:

avatarUrl.get(PixelRatio.getPixelSizeForLayoutSize(size))

I think a solution will likely have lots of interactions with #254 and #255, so the best approach might be to consider these three issues together.

Related: #254
Related: #255

@chrisbobbe chrisbobbe added this to the Launch milestone Sep 7, 2023
@gnprice gnprice added the a-api Implementing specific parts of the Zulip server API label Sep 7, 2023
@chrisbobbe chrisbobbe added the beta feedback Things beta users have specifically asked for label Feb 10, 2024
@chrisbobbe
Copy link
Collaborator Author

An observant user noticed the blurriness and reported it in chat today: https://chat.zulip.org/#narrow/stream/48-mobile/topic/flutter.3A.20blurry.20profile.20picture/near/1735359

@gnprice gnprice modified the milestones: Launch, Beta 2 Feb 13, 2024
@saisumith770
Copy link
Contributor

@gnprice I'm currently working on this feature. Finished with most of the task using gravatar's. I would like to know which formatter you are using because as I save my code most of the file gets re-formatted causing several changes in the git history. It would be really helpful if you linked the contributing guidelines as well.

@gnprice
Copy link
Member

gnprice commented Feb 25, 2024

@saisumith770 Cool — assigned you the issue, and I'll look at your PR in the next few days.

We don't use an auto-formatter, so you'll want to just tell your editor not to do that. Let's discuss in #mobile-team on chat.zulip.org (thread).

For contributing guidelines, this repo's README file has information on running tests and making changes. We also follow the same basic style of clean commit history as the Zulip project in general, which is described here:
https://zulip.readthedocs.io/en/latest/contributing/commit-discipline.html

saisumith770 added a commit to saisumith770/zulip-flutter that referenced this issue Mar 8, 2024
@gnprice gnprice closed this as completed in 58b3155 Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-api Implementing specific parts of the Zulip server API beta feedback Things beta users have specifically asked for
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants