From fdf949a50927fc1bf5a6d0226e43aca1f73e7ee4 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Mon, 6 Sep 2021 19:21:38 +0000 Subject: [PATCH] Retrieve filenames of thumbnails when rendering a PDF (#35683). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@21212 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/export/pdf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb index 251af1041..7e6252b3f 100644 --- a/lib/redmine/export/pdf.rb +++ b/lib/redmine/export/pdf.rb @@ -104,6 +104,10 @@ module Redmine atta = RDMPdfEncoding.attach(@attachments, attrname, "UTF-8") if atta return atta.diskfile + elsif %r{/attachments/thumbnail/(?[^/]+)/(?\d+)} =~ attrname and + atta = @attachments.find{|a| a.id.to_s == id} and + atta.readable? and atta.visible? + return atta.thumbnail(size: size) else return nil end -- 2.39.5