Tom Schindl wrote:
My Svg2AnyFormat-Serializer is now working. I can transform svg to png,
jpg, ... .

Ultracool! Will you be using this in production? I'd love to know.


1)
How do I pass the format to the module the svg-image should be
serialized in. At the moment I have the image-format hardcoded into my
module which has been apropriate for my testing purposes.

You have several options. I would suggest using a pnote so that people can set it which ever way they want. You could have a plugin that uses the query string (?format=png) or the filename (foo.svg.png) or whatever to set the pnote to the desired format. You could use Accept headers but that's a bit random. It could also be done using a PerlVar. Even without a plugin you could use some of the above methods:


RewriteRule ^(.*/perl\/.*).png$ $1.svg [P]

RewriteRule ^(.*/perl\/.*).png$ $1.png.svg [P]


You could even AddHandler axkit .png.

2)
Caching. How do I implement it. Is a small expample out there?

I'm probably forgetting something very important but I think it just works.



sub handler { my $class = shift; my ( $r, $xml_provider, undef, $last_in_chain ) = @_;

For safety (especially if this is going on CPAN) you probably want to throw in a die "This can only be used as the final step" unless $last_in_chain;

--
Robin Berjon <[EMAIL PROTECTED]>
Research Engineer, Expway        http://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to