summaryrefslogtreecommitdiffstats
path: root/models/avatar.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-12-09 01:12:15 +0100
committerGitHub <noreply@github.com>2020-12-09 01:12:15 +0100
commitc05701dd7d72aea75c67fbb07df928c192474686 (patch)
tree807d295c28ad57950120e0b14596168902efde0d /models/avatar.go
parent658e90a1141a03e5249770a6a670b818fe307e1d (diff)
downloadgitea-c05701dd7d72aea75c67fbb07df928c192474686.tar.gz
gitea-c05701dd7d72aea75c67fbb07df928c192474686.zip
Fix frontpage avatars (#13853)
The frontpage uses a rather strange method to obtain the commit's avatar which I've overlooked earlier. I don't exactly understand how it works but this change fixes the wrong default avatars by using the function that was in previous use. Also introduced a few constants for size an size increase factor. Fixes: https://github.com/go-gitea/gitea/issues/13844
Diffstat (limited to 'models/avatar.go')
-rw-r--r--models/avatar.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/avatar.go b/models/avatar.go
index ac260fbd93..166ca337ca 100644
--- a/models/avatar.go
+++ b/models/avatar.go
@@ -40,6 +40,12 @@ func DefaultAvatarLink() string {
// determined by the avatar-hosting service.
const DefaultAvatarSize = -1
+// DefaultAvatarPixelSize is the default size in pixels of a rendered avatar
+const DefaultAvatarPixelSize = 28
+
+// AvatarRenderedSizeFactor is the factor by which the default size is increased for finer rendering
+const AvatarRenderedSizeFactor = 2
+
// HashEmail hashes email address to MD5 string.
// https://en.gravatar.com/site/implement/hash/
func HashEmail(email string) string {