[Clipart] Make thumbnails work on openclipart.org
frederik.elwert at web.de
Wed Feb 28 12:02:35 PST 2007
As you might know, the thumbnail function on openclipart.org is
currently not working for SVG files. As a work around, I currently wrote
a UserScript (for use with Firefox+Greasemonkey and Opera) that fixes
If you just want to get it working, download the script from here:
German readers may also read my short blog entry on the topic:
If you are interested in what the script actually does, you may also
continue reading ;-)
There are two problems that prevent the correct display if the
thumbnails. First, the thumbnails are embedded by <img> elements. But
currently most browsers don't support SVGs as source for imgs. So the
script replaces the img with an object.
Second, most SVGs on openclipart.org don't have a viewBox attribute, so
they don't get scaled to fit the thumbnail size. (This may be because
Inkscape currently lacks a GUI to set a viewBox, although this would be
quite useful for cliparts). So the script sets a viewBox if it is
missing, and replaces the absolute width and height values with 100%.
I was just doing this for my own convenience, but I thought somebody
else could find this useful as well.
More information about the clipart