After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 649450 - dia: Error (python backtrace) on Plain SVG import
dia: Error (python backtrace) on Plain SVG import
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: import
0.97.x
Other Linux
: Normal normal
: 0.97.2
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-05 11:31 UTC by Roland Stigge
Modified: 2011-12-30 11:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
SVG example file (2.74 KB, image/svg+xml)
2011-05-05 11:31 UTC, Roland Stigge
Details

Description Roland Stigge 2011-05-05 11:31:15 UTC
Created attachment 187276 [details]
SVG example file

Hi,

consider loading the attached example svg file via the "svg plain" import:

==========================================================================
$ dia

(dia:22803): GLib-WARNING **: A group named "gtk" is already part of this GOptionContext
Huh? m
Huh? m
Huh? m

** (dia:22803): WARNING **: Too few BezPoints!
** (dia:22803): DEBUG: PyDiaProperty_ApplyToObject : no conversion bez_points -> bezpointarray
<type 'exceptions.TypeError'>TypeError('prop type mis-match.',)Traceback (most recent call last):
  • File "/usr/share/dia/python/diasvg_import.py", line 714 in import_svg
    return imp.Render(diagramData)
  • File "/usr/share/dia/python/diasvg_import.py", line 663 in Render
    od = o.Create()
  • File "/usr/share/dia/python/diasvg_import.py", line 303 in Create
    od = o.Create()
  • File "/usr/share/dia/python/diasvg_import.py", line 201 in Create
    self.ApplyProps(o)
  • File "/usr/share/dia/python/diasvg_import.py", line 442 in ApplyProps
    o.properties["bez_points"] = self.pts ==========================================================================

Comment 1 Hans Breuer 2011-06-05 18:57:27 UTC
Fixed by:
http://git.gnome.org/browse/dia/commit/?id=ef1e4dac749648ef6a3f1712ac6a9aa756c04c3a

The SVG importer is limited, e.g. when parsing path data. It stayed this way but now produces a more understandable error message.
Comment 2 Hans Breuer 2011-12-17 15:49:39 UTC
Cherry-picked to dia-0-97
Comment 3 Roland Stigge 2011-12-29 20:43:22 UTC
I just checked, and the problem persists in 0.97.2.
Comment 4 Hans Breuer 2011-12-29 21:27:01 UTC
The fix might not be what you expected, but it should be in DIa 0.97.2, see:
http://git.gnome.org/browse/dia/commit/?id=126b636c879fe9bc8df271875fdc7b863dfaaa8f

So what is the exact behavior you are observing? And how is that different from the fix I described?
Comment 5 Roland Stigge 2011-12-29 22:52:55 UTC
Hi,

via the Bugzilla "trace beautification" or similar, the original report seems to be cut in the middle: The original Debian report was:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623724

There, the attached file as example was loaded, and with 0.97.2, I similarly observe the following:

* Using the importer "Pixbuf SVG": File can't be selected because against the official "*.svg" wildcard, the herd.svg file (and all other *.svg files) is not listed

* Using "SVG Plain": Broken and with the warning you describe

* Using "Scalable Vector Graphics": Broken image: Only one "Herd" circle is included and a square but different from the original SVG graphics

So finally, none of the listed 3 importers work, so the bug should stay open until we have a fix.

Or did I miss sth.?

Thanks in advance,

Roland
Comment 6 Hans Breuer 2011-12-30 11:58:52 UTC
Checking the attached file against master reveals it is loadable via the standard C importer (it could also be loaded in 0.97.2 but does not look very similar to it's original dues to missing transformation support. Two changes which made loading possible are:

commit 85899d7bbcebbf61f72a801a7a95bab276354d0c
Author: Hans Breuer <hans@breuer.org>
Date:   Sun Sep 4 20:59:27 2011 +0200

    svg: style="stroke-dasharray:none;" gives a solid line now

    previously it gave LINESTYLE_DASHED with dashlength=0

commit 71090b449e69271375233415b4a5bcbe48636ecb
Author: Hans Breuer <hans@breuer.org>
Date:   Sun Aug 7 17:06:54 2011 +0200

    svg: retain current point over path split

    SVGs with relative movement produced wrong results, when that
    path was split (e.g. car.svg from Inkscape examples). Now the
    current_point is retained across the splitting loop.

    Slightly related: handle a second move command directly after
    the initial one gracefully (there are too many borked SVG generators;))


These are not going to be back ported to 0.97, so this bug report should remain like I originally understood: a fixed limitation of the PyDia SVG error reporting.