Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#14210 closed bug (fixed)

Incorrect order of gradient stops in SVG export

Reported by: joshas Owned by: stippi
Priority: normal Milestone: R1/beta3
Component: Applications/Icon-O-Matic Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
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 (6)

comment:1 by waddlesplash, 5 years ago

Platform: x86-64All

Not a platform-specific issue.

comment:2 by Janus, 5 years 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, 5 years 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"/>

comment:4 by Janus, 5 years 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.

comment:5 by pulkomandy, 3 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev54487.

comment:6 by nielx, 3 years ago

Milestone: UnscheduledR1/beta3

Assign fix to milestone:R1/beta3, as it looks like this fix will be part of that release.

As we started with the previous beta, we would like to use the Milestone field for fixed tickets to log from which release the improvement will be out. Therefore it is very much appreciated to assign the milestone when closing a ticket as fixed.

Note: See TracTickets for help on using tickets.