summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-12 03:55:56 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-12 03:55:56 +0000
commitc4a4133178b83c2c115df1947302c785b2885467 (patch)
tree10aeb523e06a613a9b8942b67cae947a23b2b4e9 /app/models/attachment.rb
parenta5b9632772294981b5c96fb5f8273a386d84f90c (diff)
downloadredmine-c4a4133178b83c2c115df1947302c785b2885467.tar.gz
redmine-c4a4133178b83c2c115df1947302c785b2885467.zip
Render PDF thumbnail using ImageMagick/GhostScript (#22481).
Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@18158 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r--app/models/attachment.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 362ac1fde..a0d712a34 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -201,7 +201,7 @@ class Attachment < ActiveRecord::Base
end
def thumbnailable?
- image?
+ image? || (is_pdf? && Redmine::Thumbnail.gs_available?)
end
# Returns the full path the attachment thumbnail, or nil
@@ -221,7 +221,7 @@ class Attachment < ActiveRecord::Base
target = thumbnail_path(size)
begin
- Redmine::Thumbnail.generate(self.diskfile, target, size)
+ Redmine::Thumbnail.generate(self.diskfile, target, size, is_pdf?)
rescue => e
logger.error "An error occured while generating thumbnail for #{disk_filename} to #{target}\nException was: #{e.message}" if logger
return nil