mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
Make AvatarRenderedSizeFactor configurable and set it to 3 (#17951)
Save a bit of bandwidth by only requesting 3-times the rendered avatar size. Factor 4 is only really beneficial on a handful of mobile phones and I don't think they are the primary device we design for. Configurability contributed by zeripath. Fixes: https://github.com/go-gitea/gitea/pull/17422 Fixes: https://github.com/go-gitea/gitea/issues/16287 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
e78ee73d71
commit
cc129d2ca2
7 changed files with 22 additions and 16 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
)
|
||||
|
||||
|
@ -141,7 +142,7 @@ func (pc *PushCommits) AvatarLink(email string) string {
|
|||
return avatar
|
||||
}
|
||||
|
||||
size := avatars.DefaultAvatarPixelSize * avatars.AvatarRenderedSizeFactor
|
||||
size := avatars.DefaultAvatarPixelSize * setting.Avatar.RenderedSizeFactor
|
||||
|
||||
u, ok := pc.emailUsers[email]
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue