Commons:Commons SVG Checker
If checking via file name do not include "File:"
Files to be checked can be loaded from Wikimedia Commons or uploaded from local file system. For details see Documentation and use talk page for feedback.
Checks[edit]
The checks are described in the JavaScript source file, which is found at MediaWiki:CommonsSvgChecker.js. As of July 2018, Wikimedia servers are using librsvg-2.40.16.
- The checks include those for the following bugs
- Phab:T5537;
<image>
element may usexlink:href
with internaldata:image/jpeg;base64,
ordata:image/png;base64,
source, but not other internal or external sources. - Phab:T7792, GNOME #129, GNOME #267; does not handle all
baseline-shift
attribute values. Code checks for working shifts ofsub
orsuper
or a zero shift; complains about other shifts. As of June 2018, Edge and Firefox do not handlesub
orsuper
shifts. (Firefox bug report.) - Phab:T11420, GNOME #49, GNOME #87;
textPath
element not supported. File:SVG Test TextAlign.svg - Phab:T32033;
stroke-dasharray
attribute with spaces not supported (f.e. File:EKG-Reto_001.svg) - Phab:T35245, GNOME #183;
text
andtspan
positioning does not support a list of positions (e.g.,x="10 15 20"
, File:Korrespondierende_Säure-Basen.svg) - Phab:T43422; Cyrillic
class
andid
do not work (ASCII only?) - Phab:T43426, GNOME #69; HSL colors are not supported.
- Phab:T43424; SVG 1.2
flowRoot
element (flowed text) not supported. Not a bug because SVG 1.2 was only a draft standard, butflowRoot
is often used by Inkscape. (f.e. File:Petit_Monde_de_Gondry,_Jonze_&_Kaufman.svg, File:SVG_FAQ-FlowRoot's_bug.svg) - Phab:T55899 (fixed 2.42.3); SVG masks do not work (f.e. File:SVG_mask.svg)
- Phab:T65236; Chinese
writing-mode
top-to-bottom text does not space correctly. File:History_of_the_Universe-zh-hant.svg, File:SVG Test TextAlign.svg - Phab:T68672, Gnome #74; SVG
style
element must includetype="text/css"
(default does not work). - Gnome #50 (fixed 2.42 / June 2018); extraneous spaces in
url()
andrgba()
values cause failure - https://noc.wikimedia.org/conf/fc-list // 11/2015 ; only certain fonts are supported.
- Other problems exist but are not checked.
- Text ignores
alignment-baseline
attribute. File:SVG Test TextAlign.svg - GNOME #249; Text with
direction="rtl"
mishandlestext-anchor
. For example, RTL text with an anchor ofstart
should begin at the specified location and develop to the left. File:SVG Test TextAlign.svg - Text with
tspan
and differingtext-anchor
attributes must have absolute position change required by SVG 1.1. (The SVG 1.1 layout rules say an absolute position change creates a new text chunk for layout;text-anchor
is done within a text chunk. A relative position change does not create a new text chunk, so atext-anchor
change would be ignored.) - Text uses wrong baseline for Arabic. The Arabic baseline (e.g., ليالي العرب) is higher than the Latin baseline.
- Phab:T25643; SVG specifies font's PostScript name (e.g.,
font-family="Helvetica-Bold"
) rather than a separate family and weight (e.g.,font-family="Helvetica" font-weight="bold"
). Checker will flag the font file as an unknown font. This problem is common with Adobe products and Macintosh systems. - Phab:T36947; There is a small font size quantization issue. File:StrekenProvincieUtrecht1.svg
- Phab:T43423; CSS child selectors are not supported by librsvg.
- Phab:T68551; CSS classes on
text
elements are not inherited by childtspan
elements. If you want this, you need to add a separate class fortspan
as well, or use simply groups (but not in the text element as it Scour unfortunately does). - Phab:T64987, Phab:T184369, Gnome #95;
font-family="'font name'"
(internally quoted font family name) does not work (File:Mathematical_implication_diagram-alt.svg, File:T184369.svg)
- fonts such as "Sans" are not generating warnings despite being in a list:
var gFontSubstitution2 = [ "sans", "Sans", "Serif" ];
- Try, for example, File:MenstrualCycle ca.svg: check
xlink:href
attribute; may not reference external resources in most elements. For example, an external resource may be referenced ina
elements, but not inuse
elements. https://www.w3.org/TR/SVG11/linking.html#IRIReference<use transform="matrix(-1 0 0 -1 0 0)" xlink:href="#a"/>
does not work if it is mirrored two times (-1): File:Labanotation2.svg<feGaussianBlur>
seems to be a bit different from browsers: (f.e. File:Oxygen480-status-weather-clear-night.svg, File:Mahuri.svg, File:Pittsburgh_newspaper_consolidation_timeline.svg)- Librsvg_bugs#Pattern on small scales (f.e. File:Pong.svg, File:Languages-Europe_edit.svg)
tref
is in SVG 1.1, but it is not supported by most user agents (includinglibrsvg
) and is removed in an SVG 2.0 candidate recommendation. See SVG 2.0, W3C Candidate Recommendation 15 September 2016, "Appendix L: Changes from SVG 1.1", https://www.w3.org/TR/SVG2/changes.html- Phab:T88833, Gnome #108 (fixed in 2.42.3);
librsvg
does not do the CSS 2.1 stylefont-size: smaller
(relative size change) librsvg
does not do the CSS 2.1 styletext-transform: uppercase
(uppercase/lowercase/capitalize string)- SVG 1.1(2nd)
font-variant="small-caps"
not supported. File:SVG Test TextAlign.svg - GNOME #131, GNOME #256;
systemLanguage
errs with hyphenated languages - GNOME #88;
textLength
not supported. File:SVG Test TextAlign.svg - Phab:T60920 Semantics of lang parameter are confused.
- Phab:T200443 A
text
element with atext-anchor
of"middle"
or"end"
may not work if there is atspan
element withx
ory
attributes followed by a #text node. - librsvg does not render
a
element children oftext
element. - MW blocks upload of
a
elements withhref
attribute (SVG 2.0) (see https://www.w3.org/Graphics/SVG/WG/wiki/Href); MW permits upload ofa
elements withxlink:href
attribute (SVG 1.1). - Phab:T228321
librsvg
<librsvg2-2.45.6
does not like single quotation marks in functURLs that are used in, for example, gradient fills. Instead offill="url('#ident')"
usefill="(#ident)"
. See File:SVG Gradient.svg. - Phab:T228325 GNOME #48
librsvg
gradient fills usinggradientUnits="userBoundingBox"
(the default) in rotated user space do not work correctly. See File:SVG Gradient.svg. - Phab:T270889 MW may not detect
systemLanguage
attributes in large SVG files. By default, MW only scans the first$wgSVGMetadataCutoff
= 256 kB[1] of an SVG file, so MW may incorrectly conclude the file does not have translations, or MW may omit some languages from the language dropdown. See File:Antarctica.svg. - Phab:T217990
librsvg
does not parsepath
elements with arcs correctly. SVG arcs have single-character flags that do not need to be separated with commas or spaces, butlibrsvg
needs the separators. Consequently, arcs in the illustration may start in the expected place, but they may have an odd shape and finish somewhere unexpected. - Phab:T276684 A
use
elementxlink:href
links to anotheruse
element. - phab:T304190 SVG 1.1 requires
image
elements to have theheight
andwidth
attributes. If those attributes are not present, thenlibrsvg
does not render the image and stops further rendering. A validation using the SVG 1.1 DTD will detect this error. - SVG 1.1
symbol
elements withstyle="overflow:visible"
will not work if they draw outside of theirviewBox
. The SVG 2.0symbol
attributesrefX
andrefY
are not supported. - Commons restricts SVG files to a small set of whitelisted XML namespaces.
- Commons SVG Checker does not look for potential problems with SVG Translate. (See also Phab:T250330.)
- SVG Translate does not work when CSS ID selectors are used: Phab:T221382
- SVG Translate does not work when CSS ends abruptly: Phab:T271595
- SVG Translate does not work when the `text` elements have differing numbers of `tspan` elements.
- SVG Translate does not handle deeply nested `tspan` elements (e.g., subscripts, font changes, or color changes).
Disclaimer[edit]
The Commons SVG Checker relies on third party services. By executing a check your browser sends the usual information attached to HTTP-requests (IP-address, User Agent, Timestamp) to a web service located at https://tools.wmflabs.org/convert/. The service is maintained by Rillke, and server by the Wikimedia Foundation. Rillke does not track these requests but they may show up (anonymized) in the error logs.