Incorrect rendering of radial gradients

Bug #913431 reported by Alexandre Prokoudine
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
High
Unassigned

Bug Description

The report is coming from Andrey Bayrak of SVG Cleaner team.

According to SVG standard, default values for cx, cy and r elements for radialGradients is 50%. To quote it: “If the attribute is not specified, the effect is as if a value of '50%' were specified.”

That means if cx and cy are 1/2 of viewBox's width and height, they can be safely wiped during optimization. E.g. Firefox will render such an optimized SVG file just fine, but Inkscape won't.

Andrey illustrates that with two attached files: database-bug.svg is the optimized version of database-normal.svg and has the cx="64" attribute removed from lines 112 and 114.

Revision history for this message
Alexandre Prokoudine (alexandre-prokoudine) wrote :
Revision history for this message
Alexandre Prokoudine (alexandre-prokoudine) wrote :
description: updated
su_v (suv-lp)
tags: added: gradient svg
Revision history for this message
su_v (suv-lp) wrote :

Difference in rendering reproduced with Inkscape 0.48.2 and 0.48+devel r10860 on OS X Lion,
compared to how Firefox 9 and Chromium 18 render the file

Note:
- while Opera 11.6 and Squiggle (Batik 1.7) also appear to render the two versions identically, they do not agree with Firefox and Chromium about how to render the radial gradients of the stacked objects in the background.
- rsvg-view doesn't render the objects stacked in the background, and also shows a difference (in the background) between the two versions.

Any chance to get a more reduced test case?

<off-topic>
BTW - Squiggle (Batik 1.7) initially refused to open both SVG files with the error message
  Unsupport SVG version '1'
Changing 'version="1"' to 'version="1.0"' fixed that.
<http://www.w3.org/TR/SVG11/struct.html#SVGElementVersionAttribute>
</off-topic>

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Alexandre Prokoudine (alexandre-prokoudine) wrote :

> Any chance to get a more reduced test case?

You mean, a file with less objects?

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

@prokoudine - a reduced test case, as simple as possible (without viewBox, clips/masks, filter effects and matrix transformations on nested groups), which renders identically in most modern SVG viewers (even before getting cleaned).

Revision history for this message
su_v (suv-lp) wrote : [Bug 913431] Re: Incorrect rendering of radial gradients

Reduced test case

Firefox 9, Chromium 18, Squiggle (Batik 1.7):
- all gradients are rendered identically
   cx = cy = fx = fy = 200px = 1/2 of current viewport
   viewport: <svg height="400" width="400">

Inkscape 0.48.2, 0.48+devel r10865 as well as rsvg-view 2.34.2:
- focus stays centered (unchanged)
- center apparently offset by r * gradientTransform * (-1)
   if cx / cy omitted (assumed default would be 400px / 2 = 200px)

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

Screenshot comparing reduced test case in Inkscape 0.48+devel r10865 (upper row) and Squiggle/Batik 1.7 (lower row) on OS X Lion.

Revision history for this message
jazzynico (jazzynico) wrote :

Setting importance to "High" (SVG-compliant documents misinterpreted).

Changed in inkscape:
status: Confirmed → Triaged
importance: Undecided → High
Nathan Lee (nathan.lee)
tags: added: bug-migration
Revision history for this message
Nathan Lee (nathan.lee) wrote :

Hi - thanks for reporting this bug, I've manually migrated it to Inkscape's new
bug tracker on GitLab, and closed it here.

Since the nature of the bug has changed a bit in 1.0alpha, I have updated the description. Its still a bug :(

Please feel free to file new bugs about the issues you're seeing at
http://inkscape.org/report.

Moved to: https://gitlab.com/inkscape/inbox/issues/415
Closed by: https://gitlab.com/nathanal

Changed in inkscape:
status: Triaged → Invalid
Revision history for this message
Nathan Lee (nathan.lee) wrote :

I forgot to add, but changing pattern issue tracked in https://gitlab.com/inkscape/inkscape/-/issues/781 and gradient has a bug too, possibly https://gitlab.com/inkscape/inkscape/-/issues/787

Revision history for this message
Nathan Lee (nathan.lee) wrote :

Ignore that, wrong issue!

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.