User image is blurry on high dpi device #1479

Open
opened 2023-04-06 10:48:02 +00:00 by dpschen · 7 comments
Member

Reason

So that it isn't blurry on high dpi devices, like mobile.

Related: Where do we know where to pick those two letters we use from the name?

### Reason So that it isn't blurry on high dpi devices, like mobile. Related: Where do we know where to pick those two letters we use from the name?
konrad added the
kind/feature
label 2023-04-06 11:43:51 +00:00
Owner

Related: Where do we know where to pick those two letters we use from the name?

It's only picking the first letter of the username.

The generation happens here: https://kolaente.dev/vikunja/api/src/branch/main/pkg/modules/avatar/initials/initials.go#L138-L141

> Related: Where do we know where to pick those two letters we use from the name? It's only picking the first letter of the username. The generation happens here: https://kolaente.dev/vikunja/api/src/branch/main/pkg/modules/avatar/initials/initials.go#L138-L141
Author
Member

Ahh that's good!

I think I'll reimplement that with a vue component in the frontend.

Ahh that's good! I think I'll reimplement that with a vue component in the frontend.
Owner

I think we should keep doing that in the api. Right now all avatar logic is built in the api so that the frontend only needs to show whatever avatar it is given by the api.

(It is completely possible to generate svg avatars in go, we already do that with the marble avatar option)

I think we should keep doing that in the api. Right now all avatar logic is built in the api so that the frontend only needs to show whatever avatar it is given by the api. (It is completely possible to generate svg avatars in go, we already do that with the marble avatar option)
Author
Member

My idea for the component was to reduce dependency on server (now that I think of it will probably introduce a dependency which is actually worse), reduce download bandwidth (I know also insignificant), but mostly remove blurriness. The latter is really annoying on highdpi. Any way to support highdpi for the avatars?

My idea for the component was to reduce dependency on server (now that I think of it will probably introduce a dependency which is actually worse), reduce download bandwidth (I know also insignificant), but mostly remove blurriness. The latter is really annoying on highdpi. Any way to support highdpi for the avatars?
Owner

now that I think of it will probably introduce a dependency which is actually worse

Exactly…

Any way to support highdpi for the avatars?

There's a size parameter which lets the frontend request avatars in different sizes. We could let the frontend load avatars in a higher resolution, then only need a way to detect a hdpi monitor to avoid the higher bandwidth on non-hdpi monitors.

> now that I think of it will probably introduce a dependency which is actually worse Exactly… > Any way to support highdpi for the avatars? There's a `size` parameter which lets the frontend request avatars in different sizes. We could let the frontend load avatars in a higher resolution, then only need a way to detect a hdpi monitor to avoid the higher bandwidth on non-hdpi monitors.
Author
Member

Using srcset that's not even necessary, because the browser would do this on its own.

Using `srcset` that's [not even necessary](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset), because the browser would do this on its own.
Owner

Even better 👍

Even better 👍
dpschen changed title from Create user image as SVG instead to User image is blurry on high dpi device 2023-04-06 13:40:38 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1479
No description provided.