Page MenuHomePhabricator

PNG thumbnail of a specific SVG file uploaded to Commons is clipped / cut at some sides
Closed, DuplicatePublic

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.

Related Objects

Event Timeline

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

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

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.

Issue still occurs with rsvg-convert version 2.48.4, so just waiting for an update won't work.

20170405132747!UK_traffic_sign_542.1_(1981).svg.png (160×220 px, 4 KB)