Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double the avatar size factor #15941

Merged
merged 4 commits into from
May 22, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/avatar.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions modules/repository/commits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]"))

assert.Equal(t,
"https://secure.gravatar.com/avatar/"+
fmt.Sprintf("%x", md5.Sum([]byte("[email protected]")))+
"?d=identicon&s=56",
"?d=identicon&s=112",
pushCommits.AvatarLink("[email protected]"))
}

Expand Down