diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index ee890a44..537e8466 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -488,6 +488,10 @@ class DmsfFile < ActiveRecord::Base (image? || pdf? || video? || html?) ? 'inline' : 'attachment' end + def thumbnailable? + image? && Redmine::Thumbnail.convert_available? + end + def preview(limit) result = +'No preview available' if text? diff --git a/app/views/dmsf_files/_thumbnails.html.erb b/app/views/dmsf_files/_thumbnails.html.erb index 13763564..ca8e0a71 100644 --- a/app/views/dmsf_files/_thumbnails.html.erb +++ b/app/views/dmsf_files/_thumbnails.html.erb @@ -22,7 +22,7 @@ <% # Thumbnails %> <% if defined?(thumbnails) && thumbnails %> - <% images = links.map{ |x| x[0] }.select(&:image?) %> + <% images = links.map{ |x| x[0] }.select(&:thumbnailable?) %> <% if images.any? %> <% if link_to # Redmine classic %>