Commons:Commons SVG Checker/Documentation

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

SVG is a very popular and high quality format for graphics on Wikimedia project. Nevertheless Wikimedia doesn't deliver SVG files but provides rendered PNG files by default. To generate PNG files from SVG it internally relies on librsvg. As implementation of complex standards get never completed there is no full support of SVG and bugs are present as well.

To simplify resolving well known issues with librsvg the Commons SVG Checker parses the SVG data for the problematic structures and prints a report with useful hints.

Usage[edit]

First of all Commons SVG Checker requires to load its JS that contains its logic to work. If the load request for JS is not given in the URL while retrieving Commons:Commons SVG Checker page a button shows up on the first lines of the page. After clicking that button the page is reloaded including the missing JS.

There after three sections appear. The File loading section provides two input fields with a button beneath. The first is for referencing files available on Commons by providing its page name (e.g. File:Example.svg). The second input field opens a file menu after clicking on it and provides the option to load files from local file system to the checker. Each input field has an execute button. After clicking on that a check of the select SVG file is executed. Results of the check are provided in section Analyser Log providing hints of possible issues and some meta information. With a short transmission delay as well the SVG file is rendered as PNG in the Preview. (It is sent to a service providing librsvg setup very similar to Wikimedia). Each time the check is executed the previous results get deleted.

Features[edit]

  • Can access files on Commons
  • Files on Commons can be referenced via URL parameter
  • Also local files can be used and no upload to commons is necessary
  • Metrics available via Pageviews Analysis
  • Written in JS the programming language of Wikipedia scripters
  • Uses XML processor so it is easily extensible with simple code

Retrieve version of SVG renderer used to create preview images here.

Known Issues[edit]

  • Poor URL encoding
  • File:Flag_of_the_Tuvan_People's_Republic_(1930-1933).svg // Namespace
  • Lots of typos...
  • ...

Tests[edit]

Style[edit]

See also[edit]