Page MenuHomePhabricator

[Upstream] c-librsvg2.40 Radial gradient lost at small thumbnail sizes
Closed, ResolvedPublicBUG REPORT

Description

Reported downstream at https://en.wikipedia.org/wiki/Wikipedia:SVG_help#Radial_gradient_lost_at_small_thumbnail_sizes by @Cmglee

List of steps to reproduce :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg width="149" height="149" usvg:version="0.9.1" viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg" xmlns:usvg="https://github.com/RazrFalcon/resvg">
 <radialGradient id="a" fx=".25" fy=".25">
  <stop stop-opacity="0" offset=".5"/>
  <stop stop-opacity=".05" offset=".7"/>
  <stop stop-opacity=".25" offset=".99"/>
 </radialGradient>
 <circle r="1e4" fill="#fff"/>
 <circle transform="translate(-1e4)" cx="1e4" r="300" fill="url(#a)" stroke="#f00" stroke-opacity="0"/>
</svg>

source: https://commons.wikimedia.org/wiki/File:Comparison_gender_life_expectancy_CIA_factbook_phab.svg

What happens?:
Radial gradient lost at small thumbnail sizes

librsvg240Bug_librsvg24021.png (149×149 px, 1 KB)

What should have happened instead?:

rust-librsvg2.50resvgInkscapeBatik
librsvg240Bug_librsvg251.png (149×149 px, 3 KB)
librsvg240Bug_rendersvg.png (149×149 px, 6 KB)
librsvg240Bug_Inkscape.png (149×149 px, 3 KB)
librsvg240Bug_batik.png (149×149 px, 3 KB)

Event Timeline

JoKalliauer triaged this task as Lowest priority.
JoKalliauer created this task.
JoKalliauer moved this task from Backlog to Upstream (librsvg) on the Thumbor board.
JoKalliauer moved this task from Backlog to Patch merged upstream on the Upstream board.

Just a note for possible workarounds:

removing one of
- transform="translate(-1e4)" cx="1e4"
- stroke="#f00" stroke-opacity="0"
solves the issue.
It seems that if the preview-size is smaller than half of the viewBox it is problematic. (so using a small viewBox-size might be a third workaround)

Large unnecessary transformation should be avoided, they often lead to numeric issues in librsvg.

Looks like this is fixed as a result of the thumbor upgrades.

hnowlan claimed this task.