Commons:Graphics village pump/March 2021

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

SVG file display different from PNG previews and thumbnails

Hello all, I'm having trouble with the PNG previews and displays of an SVG file that I've built with Gnuplot (version 5.2p8). Specifically, I have a plot of SAT score data, which I'm using on the English Wikipedia SAT entry page:

File:Historical_Average_SAT_Scores_(Vector).svg

The previews (any resolution) are clearly different than the SVG file (viewed by simply clicking on the image). Many of the data symbols are missing in the previews. (For example, see the red plot line in the lower left of the graph.) This effect seems to be browser independent.

I last uploaded the image in Oct 2019. I tried using the version of gnuplot I had used then (5.2p2) and uploaded that separately to another image in Wikimedia but the resulting previews are still not correct. Something on Wikimedia seems to have changed sometime since the last time I updated the image.

Can anyone help? Thanks.

--Erjwiki (talk) 21:24, 2 February 2021 (UTC)

@Erjwiki: Hi, and welcome. Have you reviewed Help:SVG? If that doesn't help, I suggest you ask at Commons:Graphic Lab/Illustration workshop.   — Jeff G. please ping or talk to me 22:02, 2 February 2021 (UTC)
Hi, Jeff, thanks for pointing out Help:SVG, lots of good things there. I do note that both the W3C validator and the Commons SVG Checker both think this file is fine (but the SVG Checker preview demonstrates the issue with the missing symbols). This may be a librsvg bug. I'll check out that workshop ... Erjwiki (talk) 22:22, 2 February 2021 (UTC)
Both lines of text should appear in the thumbnail but only one does
@Erjwiki: Nice timestamp you got there – if it were 2022, 22:22 2/2/22 would be even better!
Thanks for uncovering this bug. It seems nested use tags fail, but wrapping the inner one with a g works, e.g. replacing
<use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/>
with
<g id='gpPt8'><use xlink:href='#gpPt7' fill='currentColor' stroke='none'/></g>
restored the missing markers. I've made a demo SVG on the right.
Pinging @JoKalliauer: and @Redrose64: to check if they've seen this issue,
cmɢʟee ⋅τaʟκ 00:09, 3 February 2021 (UTC)
@Cmglee: Nice work. And that's a fairly easy workaround that I can use for future Gnuplot SVG output destined for Wikimedia until the bug can be resolved. Thanks much! — Preceding unsigned comment added by Erjwiki (talk • contribs) 15:06, 7 February 2021 (UTC)
@Erjwiki: My pleasure. Thanks for your contributions, too! cmɢʟee ⋅τaʟκ 00:56, 10 February 2021 (UTC)
@Cmglee: I don't know why I did not notice your ping. The bug was discussed in January on my talkpage User_talk:JoKalliauer#SVG_clone_of_a_clone with @Ponor: .
Imho there is no phab:-ticket, it is imho a symptom of phab:T193352 (i.e. outdated librsvg).  — Johannes Kalliauer - Talk | Contributions 15:08, 3 March 2021 (UTC)
Sorry about not reporting the bug, Jo. That whole phab: system looks like a black hole to me, things get in but very few get out :D I wasn't sure anything would be done about this bug, especially because you said the latest version of the library had no issues with cloned clones. Ponor (talk) 15:24, 3 March 2021 (UTC)
@JoKalliauer: and @Ponor: : Thanks for looking into it. I think the bug is new as I've used this construct many times in the past without trouble. I'll use the <g> workaround for now. Cheers, cmɢʟee ⋅τaʟκ 22:28, 4 March 2021 (UTC)
It seems that this issue is quite new. It seems that it did not occur in Aug 2020, but occured in Nov 2020.
I now created a phab:T276684-Ticket, to be able to refer this issue.
 — Johannes Kalliauer - Talk | Contributions 19:30, 6 March 2021 (UTC)
@JoKalliauer: thanks so much for raising the ticket, Johannes. Great troubleshooting to find that it started with File:Comparison_optical_telescope_primary_mirrors_PL.svg – interesting coincidence it's one of mine too. Cheers, cmɢʟee ⋅τaʟκ 20:52, 6 March 2021 (UTC)