[l2h] Svg?

Bruce Miller bruce.miller@nist.gov
Thu, 24 Oct 2002 10:38:55 -0400


Victor Zagorski wrote:

>Hello Manuel,
>
>Wednesday, October 23, 2002, 9:32:44 PM, you wrote:
>
>
>>>>The graphic{s|x} packages for l2h now support directly using raster
>>>>images (png, gif, jpeg) w/o going through pstoimg. [The conversion
>>>>raster->eps->raster can often be pretty lossy, even ignoring the colors,
>>>>unless you get the scale _just_ right.]
>
>
>Can I make it to use the same tech for svg files. I usually use
>drawings, and want to have max quality.


Cool idea!   

in principle -- I haven't gotten involved with SVG yet.
Do you have to link it to html (as opposed to embedding it
in xhtml)? Or alternatively is there any sort of xxtidy
program that can xhtml-ize l2h's output?

At any rate, extending graphic{s|x} would be the `Right Thing';
styles/graphics-support.perl, in particular.

Currently, the strategy (assuming it's found an image of appropriate
format) is to check the options for `simple' cases
where the images can be used as-is (at most with scaling via 
modified width & height attributes).

If the options aren't simple (clipping, rotations, etc) it converts 
the image to pbm format and passes it through a sequence of filters 
in the netpbm package and finally back to a png,gif or jpeg format.

To add support for svg, you'd have to add that file extension to
a list of known extensions, and add a branch within the main image
processing routine to skip the whole netpbm processing.
You'd have to figure out how each of the options would be applied 
to the image and generate the appropriate html code to embed/link
to the resulting image.

Hope that gives a hint of how to proceed.

bruce