diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e2eebfa41..e21dabe5c 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 + thumbnail_path = thumbnail_path(attachment, :size => thumbnail_size * 2) link_to( image_tag( - thumbnail_path(attachment), - :srcset => "#{thumbnail_path(attachment, :size => thumbnail_size * 2)} 2x", + thumbnail_path, + :srcset => "#{thumbnail_path} 2x", :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;", :loading => "lazy" ), diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 859fb2ff7..e47462b21 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2756,7 +2756,7 @@ class IssuesControllerTest < Redmine::ControllerTest end assert_select 'div.thumbnails' do assert_select 'a[href="/attachments/16"]' do - assert_select 'img[src="/attachments/thumbnail/16"]' + assert_select 'img[src="/attachments/thumbnail/16/200"]' end end end 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