From e873a264e482655b4ca5d607f9949f5be957f723 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Thu, 30 Sep 2010 13:11:26 +0000 Subject: [PATCH] Final fix of 4164, problems with cairo: out of memory for mult pages in Grapviz output. svn: r15941 --- src/gui/plug/report/_graphvizreportdialog.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/plug/report/_graphvizreportdialog.py b/src/gui/plug/report/_graphvizreportdialog.py index 6558e6bc2..bb3424e18 100644 --- a/src/gui/plug/report/_graphvizreportdialog.py +++ b/src/gui/plug/report/_graphvizreportdialog.py @@ -451,7 +451,9 @@ class GVPsDoc(GVDocBase): command = 'dot -Tps:cairo -o"%s" "%s"' % (self._filename, tmp_dot) dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] - if dotversion.find('2.26.3') != -1: + # Problem with dot 2.26.3 and multiple pages, which gives "cairo: out of memory" + # If the :cairo is skipped for these cases it gives acceptable result. + if dotversion.find('2.26.3') != -1 and (self.vpages * self.hpages) > 1: command=command.replace(':cairo','') os.system(command) # Delete the temporary dot file @@ -785,7 +787,9 @@ class GVPdfGsDoc(GVDocBase): command = 'dot -Tps:cairo -o"%s" "%s"' % ( tmp_ps, tmp_dot ) dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] - if dotversion.find('2.26.3') != -1: + # Problem with dot 2.26.3 and multiple pages, which gives "cairo: out of memory" + # If the :cairo is skipped for these cases it gives acceptable result. + if dotversion.find('2.26.3') != -1 and (self.vpages * self.hpages) > 1: command=command.replace(':cairo','') os.system(command)