Transformations are ignored when separated by comma (manually coded svg misinterpreted)

Bug #1365058 reported by Heikki Heikkilä
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

$ inkscape --version
Inkscape 0.48.4 r9939 (Jan 22 2014)

$ uname -a
Linux hh-desktop22 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Svg file "sphere.svg" looks visually incorrect when opened with
inkscape. Note that "sphere.svg" is NOT created with
inkscape, but a separate ad hoc program has been used to calculate
the shapes and positions of the relevant ellipses.
The SVG standard was consulted when preparing the svg file, so it
can be assumed to look correct.

The picture is supposed to show a stylisized perspective view of
a translucent globe, viewed infinitely far away from an angle
of 25 degrees (northward from equatorial plane). The first <circle/>
command draws the outer edge. The next two <path/> commands
draw the equator, in two pieces (the other half dashed). The
next four <path/> commands draw two meridians; they cross at poles
at an angle of 90 degrees (which, in a perspective 2D projection, is
of course not 90 degrees). The north pole is the intersection of
the solid lines, the south pole, dashed lines. The next <ellipse/>
command draws parallel 75 degrees North with solid line; the next four
<path/> commands draw parallels 45 North and 45 South; and the last
<ellipse/> command draws parallel 75 South, with dashed line.

Observations:

1. When the svg file is opened with inkscape 0.48.4, it looks
incorrect on the display screen. Specifically, the lines drawn
with <path/> commands are offset (as if inkscape didn't understand
"translate(100,100)"), and rotation of meridian ellipses is not done.

2. When inkscape is asked to save the picture in png format,
the result is similarly incorrect.

3. When the png file is viewed with Mozilla Firefox 32.0,
it looks incorrect, like in inkscape.

4. But if the original svg file is viewed with Firefox, it looks
correct. For this reason I assume the the svg code is correct.

Contents of sphere.svg:

<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1800 1800">
<circle cx="800" cy="800" r="800" fill="none" stroke="black" stroke-width="7" transform="translate(100,100)" />
<path stroke="black" stroke-width="7" fill="none" d="M 0 800 A 800 338.0946 0 0 0 1600 800 " transform="translate(100,100), rotate(0.0000,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 0 800 A 800 338.0946 0 0 1 1600 800 " stroke-dasharray="7,17" transform="translate(100,100), rotate(0.0000,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 0 800 A 800 512.6851 0 0 0 1600 800 " transform="translate(100,100), rotate(247.0902,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 0 800 A 800 512.6851 0 0 1 1600 800 " stroke-dasharray="7,17" transform="translate(100,100), rotate(247.0902,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 0 800 A 800 512.6851 0 0 0 1600 800 " transform="translate(100,100), rotate(112.9098,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 0 800 A 800 512.6851 0 0 1 1600 800 " stroke-dasharray="7,17" transform="translate(100,100), rotate(112.9098,800,800)" />
<ellipse cx="800" cy="800" rx="207.0552" ry="87.5053" fill="none" stroke="black" stroke-width="7" transform="translate(100,-600.3409)" />
<path stroke="black" stroke-width="7" fill="none" d="M 299.5819 175.8352 A 565.6854 239.0690 0 1 0 1300.4181 175.8352 " transform="translate(100,100), rotate(0.0000,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 299.5819 175.8352 A 565.6854 239.0690 0 0 1 1300.4181 175.8352 " stroke-dasharray="7,17" transform="translate(100,100), rotate(0.0000,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 299.5819 1424.1648 A 565.6854 239.0690 0 0 0 1300.4181 1424.1648 " transform="translate(100,100), rotate(0.0000,800,800)" />
<path stroke="black" stroke-width="7" fill="none" d="M 299.5819 1424.1648 A 565.6854 239.0690 0 1 1 1300.4181 1424.1648 " stroke-dasharray="7,17" transform="translate(100,100), rotate(0.0000,800,800)" />
<ellipse cx="800" cy="800" rx="207.0552" ry="87.5053" fill="none" stroke="black" stroke-width="7" stroke-dasharray="7,17" transform="translate(100,800.3409)" />
</svg>

Revision history for this message
su_v (suv-lp) wrote :

Attaching file to ease testing …

Revision history for this message
su_v (suv-lp) wrote :

AFAICT renders as expected in Inkscape 0.48.5 and 0.91pre2 after removing the commas in the 'transform' attributes (didn't check in detail what the current SVG 1.1 spec says).

tags: added: svg transformations
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with unmodified test case on OS X 10.7.5 with
- rsvg-view-3 (librsvg 2.40.3)
- Inkscape 0.48.5 (r10040)
- Inkscape 0.91pre2 r13543

whereas Squiggle (Batik 1.7), Firefox, Chromium and Safari render the globe as described.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Earlier related report (sample file also uses comma as separator in lists of transformations):
- Bug #1346677 “Some missing element with importing svg”
  <https://bugs.launchpad.net/inkscape/+bug/1346677>

Revision history for this message
su_v (suv-lp) wrote :

Setting status to 'Medium' for now.

Needs review by SVG expert (separator in list of transforms).

Changed in inkscape:
importance: Undecided → Medium
Revision history for this message
Heikki Heikkilä (heikki-heikkila) wrote :

Thanks to ~suv for a quick analysis! I could easily circumvent the problem by removing a few commas in my SVG files.

Revision history for this message
Heikki Heikkilä (heikki-heikkila) wrote :

Regarding SVG standard: http://www.w3.org/TR/SVG11/coords.html#TransformAttribute says: "The individual transform definitions are separated by whitespace and/or a comma." So it's definitly a bug if inkscape doesn't accept comma.

su_v (suv-lp)
summary: - manually coded svg misinterpreted
+ Transformations are ignored when separated by comma (manually coded svg
+ misinterpreted)
Revision history for this message
Nathan Lee (nathan.lee) wrote :

Closing as fixed in 1.0 specifically by 6c3896b861b7e23fdc2acfe5e7195f23d95011d6 (related https://gitlab.com/inkscape/inkscape/-/merge_requests/1459) in 1.0.x and 5cf910bee72e81b96807ed87ea3eeb84dbfa0182 in 1.1-dev/trunk (https://gitlab.com/inkscape/inkscape/-/merge_requests/993).

A related issue where discussion took place in the new GitLab bugtracker is https://gitlab.com/inkscape/inkscape/-/issues/492

Tested with file in Inkscape 1.1-alpha (bbbf1dd112, 2021-03-06) Linux Mint 20, compared to 0.92.5 to confirm fix occurred between these versions.

Changed in inkscape:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.