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,
On Mon, May 23, 2011 at 2:12 PM, Danny danny373@gmail.com 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.
SVG rasterization to PNG images is handled roughly the same way as thumbnailing of PNG, GIF, and JPEG images -- depending on the server settings, the transformed thumbnail file is created either at parse time (on demand when requested by a wiki page) or other reference (eg, when referenced from an API request for a thumbnail of a particular size) or that may be deferred until a custom-configured HTTP 404 handler falls through and requests the file to be generated on the fly and then stored.
See: * http://www.mediawiki.org/wiki/SVG * http://www.mediawiki.org/wiki/Manual:Image_Administration
-- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
On Mon, May 23, 2011 at 4:12 PM, Danny danny373@gmail.com 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?
http://www.mediawiki.org/wiki/Manual:Image_Administration#SVG
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.
mediawiki-l@lists.wikimedia.org