[Mediawiki-l] Generate (rendering) PNG files from SVG file

Platonides Platonides at gmail.com
Mon May 23 21:56:58 UTC 2011


Danny wrote:
> Hi!
> I'm a big fan of the MediaWiki project. I have my own, little Wiki on
> the MediaWiki engine. I wonder how do you generate the PNG files in
> various resolutions from one SVG file?
> 
> For example, on the http://en.wikipedia.org/wiki/File:SVG-logo.svg
> page where there is such a line: "This image rendered as PNG in other
> sizes: 200px, 500px, 1000px, 2000px." When I click on the link XXXps,
> Wikipedia generates a PNG file with XXXpx resolution. This is great!
> But I'm curious:
> A) Do you generate a PNG file on the fly? And how are you doing it?
> B) Or rather, preparing a PNG files before? For example, using a
> script, bot or something else.
> 
> I will be grateful for the information because it is very curious to
> me this smart solution. :)
> 
> Best regards,

The PNG is created on the fly if it doesn't exist (through the 404
handler), then cached indefinitely (changes to the image deletes the
thumbs).
Those links in commons are added using a javascript snippet.




More information about the MediaWiki-l mailing list