Opened 10 months ago

Last modified 10 months ago

#14210 new bug

Incorrect order of gradient stops in SVG export

Reported by: joshas Owned by: stippi
Priority: normal Milestone: Unscheduled
Component: Applications/Icon-O-Matic Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


Icon-O-Matic SVG export produces invalid gradients. Citing SVG specification on gradient stops:
Each gradient offset value is required to be equal to or greater than the previous gradient stop's offset value.

This results in exported SVG being rendered incorrectly.

Change History (4)

comment:1 Changed 10 months ago by waddlesplash

Platform: x86-64All

Not a platform-specific issue.

comment:2 Changed 10 months ago by Janus

I look at the code and the gradient stops are sorted... Do you have an example of an icon that produce a wrong stop offset order?

comment:3 Changed 10 months ago by joshas

One example is App_Finance icon from Haiku repository (/haiku/tree/data/artwork/icons/). When exported to SVG some linearGradient stops are in incorrect order. Notice that stops offsets start at 1 and goes down to 0. They should be in ascending order.

<linearGradient id="gradient6" gradientUnits="userSpaceOnUse" x1="23.07" y1="40.59" x2="27.13" y2="45">
  <stop offset="1" stop-color="#ffffff"/>
  <stop offset="0.4497" stop-color="#ffacac"/>
  <stop offset="0" stop-color="#a72323"/>

comment:4 Changed 10 months ago by Janus

The plot thickens, even the FlatIconImporter uses the function that sort the offset... Strange that opening the svg version and exporting again solve the order problem.

Note: See TracTickets for help on using tickets.