Hires (2x DPR) image support for Gravatars (#24927).

Patch by Jan Schulz-Hofen.

git-svn-id: http://svn.redmine.org/redmine/trunk@16313 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-01-30 19:40:57 +00:00
parent 6ef7a0fc2d
commit 79d5d30705

View File

@@ -52,6 +52,10 @@ module GravatarHelper
src = h(gravatar_url(email, options))
options = DEFAULT_OPTIONS.merge(options)
[:class, :alt, :title].each { |opt| options[opt] = h(options[opt]) }
# double the size for hires displays
options[:srcset] = "#{gravatar_url(email, options.merge(size: options[:size].to_i * 2))} 2x"
image_tag src, options
end