Skip to content

Request avatars of the appropriate sizeΒ #301

Closed
@chrisbobbe

Description

@chrisbobbe

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

Metadata

Metadata

Assignees

Labels

a-apiImplementing specific parts of the Zulip server APIbeta feedbackThings beta users have specifically asked for

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions