Defect #35027

Gantt PNG export ignores imagemagick_convert_command

Added by Go MAEDA 7 months ago. Updated 4 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:Candidate for next minor release
Resolution: Affected version:4.1.0


Gantt PNG export uses ImageMagick's convert command, but it ignores imagemagick_convert_command in configration.yml.

Steps to reproduce:

1. Set incorrect command name (e.g. /usr/bin/_convert) to imagemagick_convert_command in configration.yml
2. Restart Redmine
3. Export gantt to PNG. It should not work because imagemagick_convert_command is wrong, but it works fine.

35027.patch Magnifier (739 Bytes) Yuichi HARADA, 2021-04-19 04:29

Related issues

Duplicated by Redmine - Defect #35424: Closed


#1 Updated by Yuichi HARADA 6 months ago

It seems that you can set the path of Imagemagick's client command to MiniMagick.cli_path.

I created a patch.

diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index 122013e5a..7d078298c 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -395,6 +395,9 @@ module Redmine
           Redmine::Configuration['minimagick_font_path'].presence ||
         img = MiniMagick::Image.create(".#{format}", false)
+        if Redmine::Configuration['imagemagick_convert_command'].present?
+          MiniMagick.cli_path = File.dirname(Redmine::Configuration['imagemagick_convert_command'])
+        end do |gc|
           gc.size('%dx%d' % [subject_width + g_width + 1, height])

#2 Updated by Marius BALTEANU 6 months ago

  • Target version set to Candidate for next minor release

#3 Updated by Go MAEDA 4 months ago

  • Duplicated by Defect #35424: added

#4 Updated by Jan Catrysse 4 months ago

I tried this patch on #35424 but that did not fix the issue. Maybe something else is happening, but I'm not enough of a connoisseur :-)

Also available in: Atom PDF