Skip to content
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

Add more random Avatar generators (DiceBear, Robot) and make it configurable #17701

Closed
wants to merge 16 commits into from

Conversation

6543
Copy link
Member

@6543 6543 commented Nov 18, 2021

DiceBear: https://codeberg.org/Codeberg/avatars
Robot: https://github.com/lafriks/go-avatars
None: use default images

  • POC
  • Settings via ini
  • more tests :)

@6543 6543 added the type/enhancement An improvement of existing functionality label Nov 18, 2021
modules/avatar/avatar.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 18, 2021
@wxiaoguang
Copy link
Contributor

Can such feature be optional? I just worry if we introduce too many packages, the size of Gitea binary would become too big, sooner and sooner.

And it seems that the random avatar can use the "gravatar" mechanism, just point the gravatar webserver to the DiceBear avatar server.

@6543
Copy link
Member Author

6543 commented Nov 18, 2021

the problem ... as is what you propose would be best to solve via #2222 whitch to not exist :/

@wxiaoguang
Copy link
Contributor

Maybe #14799 can be easily fixed by a left-right mirror random avatar.

@wxiaoguang
Copy link
Contributor

Please have a look at:

@Gusted
Copy link
Contributor

Gusted commented Nov 19, 2021

Should this be added as a second option or be closed since #17707 is merged?

@6543
Copy link
Member Author

6543 commented Nov 20, 2021

I'm for a second option since it does not add much to the size ... but asap we have a plugin system we should make both to plugins and fallback to the "default" avatar

@6543
Copy link
Member Author

6543 commented Nov 21, 2021

and about the svg lib: I'll also use that for other features ... like the request to be able to upload svg as profile image etc ...

@wxiaoguang
Copy link
Contributor

ps: the random generated DiceBear avatars have beard/braid, I think it's not suitable for a general purpose avatar generator before we know user's gender or preference.

@lafriks
Copy link
Member

lafriks commented Nov 21, 2021

We could also use my library https://github.com/lafriks/go-avatars (it does generate png avatars also)

@6543 6543 added this to the 1.17.0 milestone Nov 23, 2021
@stale
Copy link

stale bot commented Apr 30, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 30, 2022
@6543 6543 added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Apr 30, 2022
@stale stale bot removed the issue/stale label Apr 30, 2022
@lunny lunny modified the milestones: 1.17.0, 1.18.0 Jun 3, 2022
@6543 6543 changed the title Add option to use DiceBear Avatars on new one Add more random Avatar generators (DiceBear & Robot) and make it configurable Jul 20, 2022
@6543 6543 changed the title Add more random Avatar generators (DiceBear & Robot) and make it configurable Add more random Avatar generators (DiceBear, Robot, Wavatars & MonsterID) and make it configurable Jul 20, 2022
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jul 20, 2022

Quote my question:

Can such feature be optional? I just worry if we introduce too many packages, the size of Gitea binary would become too big, sooner and sooner.
And it seems that the random avatar can use the "gravatar" mechanism, just point the gravatar webserver to the DiceBear avatar server.

To avoid code bloat, do we really want to introduce new avatar generators? Could the avatars be provided by external gravatar servers instead of compiling code into Gitea? Although Gitea doesn't have a plugin system, the gravatar system is exactly for such case.

@6543
Copy link
Member Author

6543 commented Jul 20, 2022

TAGS="bindata sqlite sqlite_unlock_notify" make build -j1

before (0d05bdb): 84M (85384)
at 0a0b147: 84M (85900)
at 8c6bed3: 85M (86196)

so I think we can remove monsterid and wavatars

but the rest should be good to go - and yes you can use gravatar like service but it will not be that fine granular & easy to do for selfhost admins

This reverts commit 8c6bed3.

Revert "add monsterid"

This reverts commit 309c5e1.
@6543 6543 changed the title Add more random Avatar generators (DiceBear, Robot, Wavatars & MonsterID) and make it configurable Add more random Avatar generators (DiceBear, Robot) and make it configurable Jul 20, 2022
@lunny lunny modified the milestones: 1.18.0, 1.19.0 Oct 17, 2022
@lunny lunny modified the milestones: 1.19.0, 1.20.0 Jan 31, 2023
@wxiaoguang
Copy link
Contributor

To avoid bloating Gitea's code base, let users use their own avatar service (like self-maintained gavatar) to provide their customized avatars?

After #17707 , nobody complains about swastika avatars #14799

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels May 6, 2023
@yardenshoham yardenshoham removed this from the 1.20.0 milestone May 10, 2023
@wxiaoguang
Copy link
Contributor

I am cleaning stale/pending PRs, according to the discussion and vote above, I think this PR could be closed.

@wxiaoguang wxiaoguang closed this May 12, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants