1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Fix thumbnail rendering for images with height >> width.

git-svn-id: http://svn.redmine.org/redmine/trunk@16813 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-07-10 21:19:19 +00:00
parent 60e07b9bb3
commit ffea3d5ba3

View File

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