[Clipart] Make thumbnails work on openclipart.org

Jon Phillips jon at rejon.org
Wed Feb 28 12:50:44 PST 2007


On Wed, 2007-02-28 at 21:02 +0100, Frederik Elwert wrote:
> Hello!
> 
> 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
> that.
> 
> If you just want to get it working, download the script from here:
> http://www-user.uni-bremen.de/~felwert/blog/downloads/openclipart-thumbnails.user.js
> 
> German readers may also read my short blog entry on the topic:
> http://www-user.uni-bremen.de/~felwert/blog/27-02-2007.html
> 
> If you are interested in what the script actually does, you may also
> continue reading ;-)

This is cool and bloggable!

> 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.

Is there a generic way to embed all types of media, including images, in
html? The current way cchost trys to deal with thumbnails is by cramming
whatever file has been uploaded, into the <img src="" />

> 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%.

Cool...Inkscape sets the viewBox to the canvas size now. So, I think for
our purposes, all we would need to do on our side is open and save our
current collection to fix this.

> I was just doing this for my own convenience, but I thought somebody
> else could find this useful as well.

Thanks Frederick! THis is cool...and hopefully we can get you involved
in other activities here...what areas of the project might I interest
you in?

Jon

> Regards,
> Frederik
> 
> _______________________________________________
> clipart mailing list
> clipart at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/clipart
-- 
Jon Phillips

San Francisco, CA
USA PH 510.499.0894
jon at rejon.org
http://www.rejon.org

MSN, AIM, Yahoo Chat: kidproto
Jabber Chat: rejon at gristle.org
IRC: rejon at irc.freenode.net




More information about the clipart mailing list