Check convert available by thumbnails #1357

This commit is contained in:
Karel Pičman 2022-05-17 14:43:40 +02:00
parent 6cba2f81b7
commit e0f1b4cc54
2 changed files with 5 additions and 1 deletions

View File

@ -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?

View File

@ -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 %>
<div class="thumbnails">