diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e2eebfa41..678b958a9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -319,10 +319,11 @@ module ApplicationHelper def thumbnail_tag(attachment) thumbnail_size = Setting.thumbnails_size.to_i + physical_thumbnail_size = thumbnail_size * 2 link_to( image_tag( - thumbnail_path(attachment), - :srcset => "#{thumbnail_path(attachment, :size => thumbnail_size * 2)} 2x", + thumbnail_path(attachment, :size => physical_thumbnail_size), + :srcset => "#{thumbnail_path(attachment, :size => physical_thumbnail_size)} 2x", :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;", :loading => "lazy" ), diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 452892e8b..64ef8a2de 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -1886,7 +1886,7 @@ class ApplicationHelperTest < Redmine::HelperTest assert_select_in( thumbnail_tag(a), 'a[href=?][title=?] img[src=?][loading="lazy"]', - "/attachments/3", "logo.gif", "/attachments/thumbnail/3") + "/attachments/3", "logo.gif", "/attachments/thumbnail/3/200") end def test_link_to_project