From 79d5d307056e495580af0de2a041851a33e4cb0c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 30 Jan 2017 19:40:57 +0000 Subject: 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 --- lib/plugins/gravatar/lib/gravatar.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/plugins/gravatar') 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 -- cgit v1.2.3