Opened 14 months ago

Last modified 14 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

Description

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. https://www.w3.org/TR/SVG11/pservers.html#GradientStops

This results in exported SVG being rendered incorrectly.

Change History (4)

comment:1 by waddlesplash, 14 months ago

Platform: x86-64All

Not a platform-specific issue.

comment:2 by Janus, 14 months ago

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 by joshas, 14 months ago

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"/>
</linearGradient>

comment:4 by Janus, 14 months ago

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.