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

Pascal Getreuer getreuer at gmail.com
Wed Sep 7 22:47:04 CEST 2011


Dear all,

Thanks to Miguel for his continuing efforts on SVG.

I have a question: How does one display an SVGZ file on a webpage?

On my dev.ipol page, I have an SVG image and a corresponding SVGZ:

   http://dev.ipol.im/~getreuer/out.svg
   http://dev.ipol.im/~getreuer/out.svgz

the SVG image displays correctly in Google Chrome and Firefox but for
some reason the SVGZ does not.  However, SVGZ should actually work in
these browsers, for example you can verify this on GraphViz's gallery
[1], which includes SVGZ figures.

To my understanding, an SVGZ file is created simply by running gzip on it:

   gzip -9 -c out.svg > out.svgz

Because an SVG file is plaintext, it compresses extremely well.  In my
example above, out.svg is 278 KB and out.svgz is only 36 KB (a mere
13% of the original file size).  The program Inkscape can open my
resulting SVGZ file, so it seems I am doing this correctly.

Anyways, my problem is that the SVGZ file is not working on dev.ipol.
I read that SVGZ requires that the server send a specific HTTP header
to tell the browser that the content is encoded [2].  On Apache
servers, this can be done by adding "AddEncoding gzip svgz" to the
.htaccess file, and as a result, the server adds "Content-Encoding:
gzip" to the header.  Does IPOL use Apache?

Alternatively, Is there any way to specify the content encoding of a
link within an HTML file?  Say, something like...

   <a href="out.svgz [HTTP Header: Content-Type:
   image/svg+xml; Content-Encoding: gzip]">

Could anyone point me in the right direction?

[1] http://www.graphviz.org/webdot/demo.html
[2] http://kaioa.com/node/45

Thanks,
Pascal








On Wed, Sep 7, 2011 at 11:04, Juan Cardelino <juan.cardelino at gmail.com> wrote:
> On Wed, Sep 7, 2011 at 10:48 AM, Miguel Colom
> <Miguel.Colom at cmla.ens-cachan.fr> wrote:
>> Dear all,
>>
>> 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.
>>
>> 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.
>>
>> Best,
>> Miguel
>>
>> [1] http://dev.ipol.im/~colom/svg/test.html
>
>
>
> I like this idea, however I don't  know how the server could be asked
> for a fallback image, I mean, if the browser is not capable of
> rendering it, or it renders it incorrectly, how will the server know?
> Maybe I'm missing something, but I only see this possible detecting
> the browser type and generating the content accordingly.
> Is it already working like this in your test page? Sorry about the ignorance.
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss
>


More information about the discuss mailing list