[IPOL discuss] Vector graphics on IPOL: which format to use?

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Thu Sep 8 05:26:42 CEST 2011


>>> the SVG test page [1] has been updated to show the SVG --> PNG
>>> fallback.
>>> That is, rendering an alternate PNG (or any other valid format) image when
>>> the browser is unable to render a SVG file.

I did some tests:

            img     img     object  object  embed   inline
            png     svg     svg     svg+png svg     svg
winxp
 firefox3.6 OK      -       OK      OK      OK      -
 opera11    OK      OK      OK      OK      OK      -
 ie8        OK      -       -       PNG     -       -
 chrome13   OK      OK      OK      OK      OK      OK
 chromium8  OK      OK      OK      OK      OK      OK
 safari5    OK      -       OK      OK      OK      -
 konqueror4 OK      -       OK      OK      OK      -
linux
 chromium11 OK      OK      OK      OK      OK      OK
 firefox    OK      -       OK      OK      OK      -

Please add your results for other OS/browser. I'd like to know more
about the MacOS side, and ie9 (requires windows >= vista).

So far it seems that if we want some vactor content for SVG-capable
browsers without disrupting internet explorer users, <object svg
+ png fallback> seems to be the best solution.
 
>>> In my opinion, the web server should detect when it's been asked for a
>>> fallback image and should generate the PNG version of the SVG on the fly.
> 
> I'm sorry, I've just re-read Miguel's original mail and the answers of
> my questions are there.
> +1 to this idea.

Do you mean, we would not have the PNG file stored on the server, but
- if the http server receives a request for a PNG file /path/to/foo.png
- and if there is no such PNG file /path/to/foo.png
- and there is a SVG file /path/to/foo.svg
- then some program will render the svg file in a PNG bitmap and send
  it as the answer to the request for /path/to/foo.png

This leaves some questions open:
* Which program would you use to do the SVG->PNG rendering? http
  servers don't do it, nor CherryPy. PIL doesn't read SVG. Maybe
  inkscape, or imagemagick? Then these programs must be available on
  the server whenever it is serving svg content. 
* How do you select the rendering scale of the SVG file? SVG is
  vector, and can be rendered in any arbitrary size. The expected png
  size won't be transmitted when the browser requests the PNG file.

Or maybe you mean having both SVG and PNG files available on the
server, and serving both by HTTP content negotiation?
->  http://en.wikipedia.org/wiki/Content_negotiation

Moreover, I don't understand why you want to make the server more
intelligent and more complex. My opinion is that, even if it's not
exciting, building the content and having everything available as plain
boring static files in the server is simple, stable, and
future-proof. Who will write and maintain an on-the-fly svg-to-png
conversion service?

-- 
Nicolas LIMARE - CMLA - ENS Cachan    http://www.cmla.ens-cachan.fr/~limare/
IPOL - image processing on line                          http://www.ipol.im/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20110908/438b3a4f/attachment.pgp>


More information about the discuss mailing list