From 54f281fef90faba7ba75642e2dc265f345b6f618 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 28 Aug 2022 06:35:42 +0000 Subject: Don't create two thumbnails of different resolutions for a single image (#37597). Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@21784 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/helpers') 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" ), -- cgit v1.2.3