[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63646] Long creation times for sparseimages.m

From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #63646] Long creation times for sparseimages.m in manual due to -svgconvert option to print
Date: Mon, 30 Jan 2023 16:55:36 -0500 (EST)

Update of bug #63646 (project octave):

                  Status:         Patch Submitted => Patch Reviewed         


Follow-up Comment #33:

AFAICS, octave_polygon::reconstruct does nothing for reconstruct_level < 2, so
we should probably return early 
the untouched m_polygon member rather than making a copy of it.

Something like 

--- a/src/octave-svgconvert.cc  Mon Jan 30 18:54:27 2023 +0100
+++ b/src/octave-svgconvert.cc  Mon Jan 30 22:38:54 2023 +0100
@@ -165,10 +165,12 @@
   void reset (void)
   { m_polygons.clear (); }
-  QList<QPolygonF> reconstruct ()
+  QList<QPolygonF> reconstruct (int reconstruct_level)
     if (m_polygons.isEmpty ())
       return QList<QPolygonF> ();
+    else if (reconstruct_level < 2)
+      return m_polygons;

Apart from that your patch looks good to me. I can confirm the new default
prints much faster when there are no patch or surface in the figure, like in
the original example.

Also the example in comment #20 still gives me the same numbers

sombrero (10);
ch = get (gca, "children");
set (ch, "facecolor", "r", "edgecolor", "none")
view (2)
print -nosvgconvert toto_nosvgconvert.svg
print -polymerge toto_svgconvert_base.svg
print toto_svgconvert_all.svg # -polymerge-all, the default
ls -lh toto*

i.e. decreasing file size with increasing level of reconstruction:

...179K Jan 30 22:49 toto_nosvgconvert.svg
...47K Jan 30 22:49 toto_svgconvert_all.svg
...111K Jan 30 22:49 toto_svgconvert_base.svg


Reply to this item at:


Message posté via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]