summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-09-06 19:21:38 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-09-06 19:21:38 +0000
commitfdf949a50927fc1bf5a6d0226e43aca1f73e7ee4 (patch)
treeea89ab1e52262c898f85d3b05e5f95d3b6a66a1e
parent0db3e9a7324acd7aed30ecc46c61e9bbcae6ec36 (diff)
downloadredmine-fdf949a50927fc1bf5a6d0226e43aca1f73e7ee4.tar.gz
redmine-fdf949a50927fc1bf5a6d0226e43aca1f73e7ee4.zip
Retrieve filenames of thumbnails when rendering a PDF (#35683).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@21212 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/export/pdf.rb4
1 files changed, 4 insertions, 0 deletions
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/(?<id>[^/]+)/(?<size>\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