Bug 216686 - Lines in SVG images mishandled
Summary: Lines in SVG images mishandled
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-29 17:46 UTC by Dave Farrance
Modified: 2011-07-03 18:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Farrance 2009-11-29 17:46:26 UTC
Version:            (using KDE 4.3.2)
OS:                Linux
Installed from:    Mandriva RPMs

Konqueror does not show lines in valid SVG image files, such as those created by line-drawing in Inkscape.

Take this example. It's an SVG image file with two parallel lines, one red and one blue, across a green background:

<svg xmlns="http://www.w3.org/2000/svg" width="100" height="60">
  <g>
    <rect width="60" height="60" x="20" y="0" fill="yellowgreen" />
    <path d="m 0 40 100 0" stroke="red" stroke-width="10" />
    <path d="m 0 20 l 100 0" stroke="blue" stroke-width="10" />
  </g>
</svg>

Konqueror fails to show the red line. That's because it seems to require that the lower-case-L "lineto" be put in explicitly, as is done with the blue line, but instead it's treating the second pair of coordinates as if they were a repetition of the lower-case-M "moveto" command, and thus no line is shown.  However, the last line in section 8.3.2 of the SVG spec says: "If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands", therefore the line should have been shown.

The SVG spec:
http://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands

My SVG example:
http://anvil.pwp.blueyonder.co.uk/images/test1.svg

How it looks, incorrectly, in Konqueror:
http://anvil.pwp.blueyonder.co.uk/images/test1kn.png

How it looks, correctly, in Firefox and others:
http://anvil.pwp.blueyonder.co.uk/images/test1ff.png
Comment 1 Maksim Orlovich 2009-11-29 18:06:23 UTC
Thanks for the great report... but your testcase actually passes for me, on 4.3.3.
Comment 2 Dave Farrance 2009-11-29 18:25:05 UTC
After posting that, I see that Konqueror renders it OK in web-browser mode, but not in file-manager mode. Try downloading the test case onto hard drive, then view it there with Konqueror.

http://anvil.pwp.blueyonder.co.uk/images/test1.svg
Comment 3 Maksim Orlovich 2009-11-29 18:35:48 UTC
Works fine either way for me; could you perhaps check the viewer in use under view -> view mode?
Comment 4 Dave Farrance 2009-11-29 18:42:13 UTC
This renders it incorrectly:
  view -> view mode -> Svg  Part

This renders it correctly:
  view -> view mode -> KHTML
Comment 5 Maksim Orlovich 2009-12-02 13:14:11 UTC
The SVG part is Qt's builtin SVG viewer... I guess I will need to test whether it's still broken in Qt4.6.0....
Comment 6 Martin Koller 2011-07-03 18:49:58 UTC
Works with KDE 4.6.4 and Qt 4.7.3