Project

General

Profile

Actions

Defect #32915

open

Internal Server Error occurted when exporting gantt chart to png on Windows

Added by Anonymous about 4 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Gantt
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Redmine 4.0.4 using RMagick was fine.
However, Redmine 4.1.0 using MiniMagick does not work.

prodution.log of Redmine 4.1.0 is this:

Started GET "/redmine/projects/some_project/issues/gantt.png?..." for (IP) at (date)
Processing by GanttsController#show as PNG
  Parameters: {...}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 290ms (ActiveRecord: 63.0ms)

Errno::E2BIG (Arg list too long - convert):

lib/redmine/helpers/gantt.rb:381:in `to_image'
app/controllers/gantts_controller.rb:44:in `block (2 levels) in show'
app/controllers/gantts_controller.rb:42:in `show'

On Windows, the ImageMagick's "convert" command length is too long, and then error occurred.
I want to shorten the command length or split the command if Redmine keeps using Minimagick.
And there should be some exception code as below:

--- a\lib\redmine\helpers\gantt.rb
+++ b\lib\redmine\helpers\gantt.rb
@@ -488,4 +488,15 @@
         end
         img.to_blob
+      rescue
+        MiniMagick::Tool::Convert.new do |gc|
+          # create error message image
+          gc.size('%dx%d' % [200, 50])
+          gc.xc('white')
+          gc.stroke('transparent').fill('red')
+          # and draw error message
+          gc.draw('text %d,%d %s' % [10, 20, Redmine::Utils::Shell.shell_quote('Gantt size too big.')])
+          gc << img.path
+        end
+        img.to_blob
       ensure
         img.destroy! if img

For some reason, I have to keep using Redmine on Windows...

Actions

Also available in: Atom PDF