Project

General

Profile

Defect #33283 » 33283.patch

Marius BĂLTEANU, 2020-04-19 19:50

View differences:

config/configuration.yml.example
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
#imagemagick_convert_command:
# Absolute path (e.g. /usr/bin/gs, c:/ghostscript/gs.exe) to
# the `gs` binary. Used to generate attachment thumbnails of PDF files.
#gs_command:
# Configuration of MiniMagick font.
#
# Redmine uses MiniMagick in order to export a gantt chart to a PNG image.
-- lib/redmine/thumbnail.rb.orig
++ lib/redmine/thumbnail.rb
......
extend Redmine::Utils::Shell
CONVERT_BIN = (Redmine::Configuration['imagemagick_convert_command'] || 'convert').freeze
GS_BIN = (Redmine::Configuration['gs_command'] || 'gs').freeze
ALLOWED_TYPES = %w(image/bmp image/gif image/jpeg image/png application/pdf)
# Generates a thumbnail for the source image to target
......
@gs_available = false
else
begin
`gs -version`
`#{shell_quote GS_BIN} -version`
@gs_available = $?.success?
rescue
@gs_available = false
end
end
logger.warn("gs binary (#{GS_BIN}) not available") unless @gs_available
@gs_available
end
    (1-1/1)