]> source.dussan.org Git - redmine.git/commitdiff
Fix thumbnail rendering for images with height >> width.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 10 Jul 2017 21:19:19 +0000 (21:19 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 10 Jul 2017 21:19:19 +0000 (21:19 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16813 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 52a405211f8b90cce7d024762d19b2b8befba5d6..3409bb7be6355b2986594d84e9213309737aac26 100644 (file)
@@ -220,11 +220,12 @@ module ApplicationHelper
   end
 
   def thumbnail_tag(attachment)
+    thumbnail_size = Setting.thumbnails_size.to_i
     link_to(
       image_tag(
         thumbnail_path(attachment),
-        :srcset => "#{thumbnail_path(attachment, :size => Setting.thumbnails_size.to_i * 2)} 2x",
-        :width => Setting.thumbnails_size
+        :srcset => "#{thumbnail_path(attachment, :size => thumbnail_size * 2)} 2x",
+        :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;"
       ),
       named_attachment_path(
         attachment,