-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Send size to /avatars if requested #15459
Conversation
If an avatar is requested in a particular size ensure that /avatars also gets the size request Fix go-gitea#15453 Signed-off-by: Andrew Thornton <art27@cantab.net>
@@ -82,14 +82,19 @@ func (u *User) RealSizedAvatarLink(size int) string { | |||
if u.Avatar == "" { | |||
return DefaultAvatarLink() | |||
} | |||
if size > 0 { | |||
return setting.AppSubURL + "/avatars/" + u.Avatar + "?size=" + strconv.Itoa(size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the size
parameter do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing right now - but we should probably keep sending it for future options
I think we should request higher resolution from gravatar, like requested image size times 2 like it is done for other images as well. Or maybe just hardcode to 580 which is enough for all UI use cases. https://secure.gravatar.com/avatar/f403e3d7796b4258b34481722014f370?d=identicon vs https://secure.gravatar.com/avatar/f403e3d7796b4258b34481722014f370?d=identicon&s=580 Or am I misunderstanding and this PR already does this? |
This PR means that if you request a size that size will get passed down to gravatar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm this fixes the issue with such a configuration:
[picture]
DISABLE_GRAVATAR = false
GRAVATAR_SOURCE = gravatar
ENABLE_FEDERATED_AVATAR = true
🚀 |
Backport go-gitea#15459 If an avatar is requested in a particular size ensure that /avatars also gets the size request Fix go-gitea#15453 Signed-off-by: Andrew Thornton <art27@cantab.net>
If an avatar is requested in a particular size ensure that /avatars also gets the
size request
Fix #15453
Signed-off-by: Andrew Thornton art27@cantab.net