Page MenuHomePhabricator

PNG thumbnail of a specific SVG file uploaded to Commons is clipped / cut at some sides
Open, Needs TriagePublic

Description

This SVG is apparently clipping in the WRONG place on preview.

https://commons.wikimedia.org/wiki/File:UK_traffic_signs_542.1_(1981).svg

However, having checked the viewbox in Inkscape and reducing the size of the file considerably from the original, I am puzzled as to why the clipping is wrong.

It would be nice to have a long term fix for issues like this, such as enforcing certain standards when SVG files are originally uploaded. Invalid SVG''s files shouldn't be allowed to upload.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 5 2017, 2:00 PM

Solved on a re-upload of the same nominally cleaned version, so still puzzled.

Enforcing a check for 'invalid' SVG on upload would be useful

Restricted Application added projects: Multimedia, Commons. · View Herald TranscriptApr 5 2017, 3:56 PM

Full specific links welcome which allow quick reproducing. I assume you refer to the first image version (full size) being cut at the corners in (some? all? one?) PNG thumbnail version, in contrast to the correct PNG thumbnail of the last version?

Aklapper renamed this task from Commons preview inorrectly clips an otherwise valid image. to PNG thumbnail of a specific SVG file uploaded to Commons is clipped / cut at some sides.Apr 5 2017, 6:07 PM

Full specific links welcome which allow quick reproducing. I assume you refer to the first image version (full size) being cut at the corners in (some? all? one?) PNG thumbnail version, in contrast to the correct PNG thumbnail of the last version?

Exactly

Gilles added a subscriber: Gilles.Sep 8 2017, 7:21 AM

Looking at the diff between the most recent glitched version and the fixed version, the width and height definitions look like the potential culprit:

<    width="300.00003mm"
<    height="217.8736mm"
<    id="svg2"
16,17c9,11
<    inkscape:version="0.92.1 r15371"
<    sodipodi:docname="UK traffic_signs_542.1_(1981)_WIKIMEDIA.svg">
---
>    id="svg2"
>    height="3293.8369"
>    width="4535.4336">

rsvg is probably not rounding sizes in mm like inkscape. We're due to upgrade cairo/rsvg as part of T170810 and T170810, it'll be worth checking if the more recent versions behave better with that file.

rsvg is probably not rounding sizes in mm like inkscape. We're due to upgrade cairo/rsvg as part of T170810 and T170810, it'll be worth checking if the more recent versions behave better with that file.

These updates have happened now so someone could re-test

Purged that file, the issue is still the same.

Ramsey-WMF moved this task from Untriaged to Tracking on the Multimedia board.Nov 28 2017, 8:57 PM