Sam had a good thought over at Erik's blog. In the past, I've mostly been on the side of referenced SVG for clip art - but he raises a good point.

I've just started to use clip art on my blog. I use it for a variety of reasons: To add some colour/interest, to quickly give an indication of the topic, to provide a link to a page related to the topic. I plan to reuse the clipart over-and-over again. In my opinion, the best way to do this is by using the <object> tag that references a compressed SVG file. This means the SVG content is as small as it can possibly be. It allows the browser to cache the file. If I want to update the image with a link, then I only have to update it in one place and all my entries get the updates. It also gives me a mechanism to provide fallback content for browsers that don't support SVG content (like Internet Explorer). Note that at the moment, I do not do provide fallback content because I can't be bothered to rasterize the SVGs for just one browser - but I could do this if I wanted to.

You may argue that the gzip-compressed SVG is less accessible, but I also provide the de-compressed version in the same location (just remove the 'z' from the file extension). I also have a growing list of my clip art here.

However, Sam has brought up in the past that allowing <object>s into syndicated feed formats like Atom is less secure than inline SVG itself. The other arguments in favor of inline SVG are: the image and article text are self-contained, the source can be more easily viewed, and you can't hot-link to the SVG image.

His suggestion to Erik was to provide referenced SVG <object>s in the browser, but when producing feeds to take the SVG and put it inline with the XHTML content. This is a great idea. Since my feed-producing code is now within my WordPress theme (thanks to a tip from Shelley), I might try to do this...

P.S. Something that just occurred to me: Wouldn't it also be possible for Sam to do this object->inline conversion on the planet side? Requiring everyone producing feeds to do this seems like more work than to do it in one central location.

§433 · February 27, 2008 · Software, SVG, Technology, Web, XML · Tags: , · [Print]

Comments are closed.