From 7c05f867b68600a63b91c92096d5d32bfc9a2353 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 21 May 2021 18:01:55 +0200 Subject: [PATCH 1/2] Double the avatar size factor This results on finer Avatar rendering on Hi-DPI display. --- models/avatar.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/avatar.go b/models/avatar.go index 4f02fe508981d..b4c078f8cf9ff 100644 --- a/models/avatar.go +++ b/models/avatar.go @@ -44,7 +44,7 @@ const DefaultAvatarSize = -1 const DefaultAvatarPixelSize = 28 // AvatarRenderedSizeFactor is the factor by which the default size is increased for finer rendering -const AvatarRenderedSizeFactor = 2 +const AvatarRenderedSizeFactor = 4 // HashEmail hashes email address to MD5 string. // https://en.gravatar.com/site/implement/hash/ From 5f212cb6b2f5e193fd7270b06ea4279621217608 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 21 May 2021 18:40:58 +0200 Subject: [PATCH 2/2] fix test --- modules/repository/commits_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/repository/commits_test.go b/modules/repository/commits_test.go index 16677fe8a6844..ba69a7f97ca7e 100644 --- a/modules/repository/commits_test.go +++ b/modules/repository/commits_test.go @@ -112,13 +112,13 @@ func TestPushCommits_AvatarLink(t *testing.T) { pushCommits.Len = len(pushCommits.Commits) assert.Equal(t, - "https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f?d=identicon&s=56", + "https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f?d=identicon&s=112", pushCommits.AvatarLink("user2@example.com")) assert.Equal(t, "https://secure.gravatar.com/avatar/"+ fmt.Sprintf("%x", md5.Sum([]byte("nonexistent@example.com")))+ - "?d=identicon&s=56", + "?d=identicon&s=112", pushCommits.AvatarLink("nonexistent@example.com")) }