]> source.dussan.org Git - gitea.git/commitdiff
Double the avatar size factor (#15941)
authorsilverwind <me@silverwind.io>
Sat, 22 May 2021 01:18:43 +0000 (03:18 +0200)
committerGitHub <noreply@github.com>
Sat, 22 May 2021 01:18:43 +0000 (21:18 -0400)
* Double the avatar size factor

This results on finer Avatar rendering on Hi-DPI display.

* fix test

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
models/avatar.go
modules/repository/commits_test.go

index 4f02fe508981d3bb1d006d4ffa8ef3d6cb897d55..b4c078f8cf9fff03b4fed82b14a7dc822a3a3905 100644 (file)
@@ -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/
index 16677fe8a6844a9bdbb340d0111b59c4ec839581..ba69a7f97ca7eae5b7c2898ae68ccc0e0eada84a 100644 (file)
@@ -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"))
 }