summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-30 19:40:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-30 19:40:57 +0000
commit79d5d307056e495580af0de2a041851a33e4cb0c (patch)
treec98b67fb8d00f0d8d583b78263ab9f86463cb29b /lib/plugins
parent6ef7a0fc2dc34adf78415c8a2b5ecf86eaf21f3a (diff)
downloadredmine-79d5d307056e495580af0de2a041851a33e4cb0c.tar.gz
redmine-79d5d307056e495580af0de2a041851a33e4cb0c.zip
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
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/gravatar/lib/gravatar.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/plugins/gravatar/lib/gravatar.rb b/lib/plugins/gravatar/lib/gravatar.rb
index 93c45b25c..f614f0354 100644
--- a/lib/plugins/gravatar/lib/gravatar.rb
+++ b/lib/plugins/gravatar/lib/gravatar.rb
@@ -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