mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-26 15:25:43 +03:00
Double the avatar size factor (#15941)
* 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>
This commit is contained in:
parent
44d76ff7cb
commit
be745be0a4
2 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ const DefaultAvatarSize = -1
|
||||||
const DefaultAvatarPixelSize = 28
|
const DefaultAvatarPixelSize = 28
|
||||||
|
|
||||||
// AvatarRenderedSizeFactor is the factor by which the default size is increased for finer rendering
|
// 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.
|
// HashEmail hashes email address to MD5 string.
|
||||||
// https://en.gravatar.com/site/implement/hash/
|
// https://en.gravatar.com/site/implement/hash/
|
||||||
|
|
|
@ -112,13 +112,13 @@ func TestPushCommits_AvatarLink(t *testing.T) {
|
||||||
pushCommits.Len = len(pushCommits.Commits)
|
pushCommits.Len = len(pushCommits.Commits)
|
||||||
|
|
||||||
assert.Equal(t,
|
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"))
|
pushCommits.AvatarLink("user2@example.com"))
|
||||||
|
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
"https://secure.gravatar.com/avatar/"+
|
"https://secure.gravatar.com/avatar/"+
|
||||||
fmt.Sprintf("%x", md5.Sum([]byte("nonexistent@example.com")))+
|
fmt.Sprintf("%x", md5.Sum([]byte("nonexistent@example.com")))+
|
||||||
"?d=identicon&s=56",
|
"?d=identicon&s=112",
|
||||||
pushCommits.AvatarLink("nonexistent@example.com"))
|
pushCommits.AvatarLink("nonexistent@example.com"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue