[GH-ISSUE #547] User image is blurry on high dpi device #6240

Open
opened 2026-04-20 16:49:45 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @vikunja-bot on GitHub (Apr 1, 2025).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/547

Original issue by dpschen on 2023-04-06T10:48:02.000Z

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?

Original issue on Gitea


@kolaente commented on 2023-04-06T11:45:07.000Z:

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


dpschen commented on 2023-04-06T12:08:55.000Z:

Ahh that's good!

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


@kolaente commented on 2023-04-06T12:13:29.000Z:

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)


dpschen commented on 2023-04-06T12:27:00.000Z:

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?


@kolaente commented on 2023-04-06T12:29:16.000Z:

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.


dpschen commented on 2023-04-06T12:37:07.000Z:

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


@kolaente commented on 2023-04-06T12:42:50.000Z:

Even better 👍

Originally created by @vikunja-bot on GitHub (Apr 1, 2025). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/547 _Original issue by dpschen on 2023-04-06T10:48:02.000Z_ ### 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? [Original issue on Gitea](https://kolaente.dev/vikunja/vikunja/issues/1479) --- _**@kolaente** commented on 2023-04-06T11:45:07.000Z_: > 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 --- _**dpschen** commented on 2023-04-06T12:08:55.000Z_: Ahh that's good! I think I'll reimplement that with a vue component in the frontend. --- _**@kolaente** commented on 2023-04-06T12:13:29.000Z_: 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) --- _**dpschen** commented on 2023-04-06T12:27:00.000Z_: 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? --- _**@kolaente** commented on 2023-04-06T12:29:16.000Z_: > 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. --- _**dpschen** commented on 2023-04-06T12:37:07.000Z_: 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. --- _**@kolaente** commented on 2023-04-06T12:42:50.000Z_: Even better 👍
GiteaMirror added the area/avatarsarea/mobile labels 2026-04-20 16:49:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#6240