Add possibility to define a default user avatar #12572

Closed
opened 2025-11-02 10:14:27 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @Scharunge on GitHub (Mar 1, 2024).

Feature Description

On my gitea server someting interesting happend. One of my users got a rather interesting avatar generated.

image

It would be great to be able to define a default local avatar to prevent somthing like that to happen.

Screenshots

No response

Originally created by @Scharunge on GitHub (Mar 1, 2024). ### Feature Description On my gitea server someting interesting happend. One of my users got a rather interesting avatar generated. ![image](https://github.com/go-gitea/gitea/assets/52606091/1c3ea507-f76c-48ef-8368-35c1e4b313ff) It would be great to be able to define a default local avatar to prevent somthing like that to happen. ### Screenshots _No response_
GiteaMirror added the type/proposalissue/needs-feedback labels 2025-11-02 10:14:27 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Mar 1, 2024):

On my gitea server someting interesting happend. One of my users got a rather interesting avatar generated.

What's your Gitea version? That's impossible for new Gitea, because I have fixed it: https://github.com/go-gitea/gitea/pull/17707 , since 1.16

@wxiaoguang commented on GitHub (Mar 1, 2024): > On my gitea server someting interesting happend. One of my users got a rather interesting avatar generated. What's your Gitea version? That's impossible for new Gitea, because I have fixed it: https://github.com/go-gitea/gitea/pull/17707 , since 1.16
Author
Owner

@Scharunge commented on GitHub (Mar 1, 2024):

The Server Version is 1.21.5. But the User was registerd in 2018. it only just been noticed now. I guess the already generated avatars were not been updated with the release of 1.16. But it would still be nice if I could set a default user avatar like it is possible for repositories with the REPOSITORY_AVATAR_FALLBACK_IMAGE

@Scharunge commented on GitHub (Mar 1, 2024): The Server Version is 1.21.5. But the User was registerd in 2018. it only just been noticed now. I guess the already generated avatars were not been updated with the release of 1.16. But it would still be nice if I could set a default user avatar like it is possible for repositories with the REPOSITORY_AVATAR_FALLBACK_IMAGE
Author
Owner

@wxiaoguang commented on GitHub (Mar 1, 2024):

The Server Version is 1.21.5. But the User was registerd in 2018. it only just been noticed now. I guess the already generated avatars were not been updated with the release of 1.16.

Thank you for the details. And yes, existing user avatars won't get updated automatically. So they could be manually removed and then updated on admin panel. (if there are a lot, I guess it could be done by a SQL: update all user's "email hash" avatar to empty string, then the email hash avatars will be re-generated, it could be tricky to filter such users correctly ...)

But it would still be nice if I could set a default user avatar like it is possible for repositories with the REPOSITORY_AVATAR_FALLBACK_IMAGE

I am not sure whether it is a strong requirement / how much benefit it brings. All repositories already have a "default fork-like icon" now.

@wxiaoguang commented on GitHub (Mar 1, 2024): > The Server Version is 1.21.5. But the User was registerd in 2018. it only just been noticed now. I guess the already generated avatars were not been updated with the release of 1.16. Thank you for the details. And yes, existing user avatars won't get updated automatically. So they could be manually removed and then updated on admin panel. (if there are a lot, I guess it could be done by a SQL: update all user's "email hash" avatar to empty string, then the email hash avatars will be re-generated, it could be tricky to filter such users correctly ...) > But it would still be nice if I could set a default user avatar like it is possible for repositories with the REPOSITORY_AVATAR_FALLBACK_IMAGE I am not sure whether it is a strong requirement / how much benefit it brings. All repositories already have a "default fork-like icon" now.
Author
Owner

@Scharunge commented on GitHub (Mar 1, 2024):

I just think it would make sense if you could set a standard avatar in a commercial environment.

@Scharunge commented on GitHub (Mar 1, 2024): I just think it would make sense if you could set a standard avatar in a commercial environment.
Author
Owner

@silverwind commented on GitHub (Mar 1, 2024):

There is avatar_default.png which could be overridden via the custom folder:

https://github.com/go-gitea/gitea/blob/main/public/assets/img/avatar_default.png

I think for it to show, you need to disable the autogenerated avatars in the config and it won't affect existing users until you delete their avatar file, only new ones.

@silverwind commented on GitHub (Mar 1, 2024): There is `avatar_default.png` which could be overridden via the `custom` folder: https://github.com/go-gitea/gitea/blob/main/public/assets/img/avatar_default.png I think for it to show, you need to disable the autogenerated avatars in the config and it won't affect existing users until you delete their avatar file, only new ones.
Author
Owner

@wxiaoguang commented on GitHub (Mar 1, 2024):

There is avatar_default.png which you be overridden via the custom folder:

Repository is different. Repository uses builtin default avatar (a "book" icon or a "git fork" icon) if the user hasn't uploaded one.

@wxiaoguang commented on GitHub (Mar 1, 2024): > There is `avatar_default.png` which you be overridden via the `custom` folder: Repository is different. Repository uses builtin default avatar (a "book" icon or a "git fork" icon) if the user hasn't uploaded one.
Author
Owner

@Scharunge commented on GitHub (Mar 1, 2024):

If I understand @silverwind correctly. This setting should activate the avatar_default.png instead of a generated gravatar?

image

I just deleted my profile picture and got this:
image
should`t it be that one?
image

@Scharunge commented on GitHub (Mar 1, 2024): If I understand @silverwind correctly. This setting should activate the avatar_default.png instead of a generated gravatar? ![image](https://github.com/go-gitea/gitea/assets/52606091/56af85f5-35c4-4eac-95b1-ea96977ff429) I just deleted my profile picture and got this: ![image](https://github.com/go-gitea/gitea/assets/52606091/5a0f05c1-6dab-44f7-8491-f9a8d0801bf5) should`t it be that one? ![image](https://github.com/go-gitea/gitea/assets/52606091/44e8087c-ff00-4f17-ac4c-c46322fff421)
Author
Owner

@GiteaBot commented on GitHub (Mar 31, 2024):

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot commented on GitHub (Mar 31, 2024): We close issues that need feedback from the author if there were no new comments for a month. :tea:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12572