Am Fre, 2003-02-28 um 14.55 schrieb Robin Berjon:
> 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)

Well if I manage to implement the Caching of the serialized image i like
to use it in some of my projects to visulize multiple things e.g. create
er diagramms of database which i have already running with Cocoon.

http://ferrum.bestsolution.at:8080/cocoon/torque-doc/index.html

2) The underlying Image::Magick-Libray does not support everything svg
provides. But its getting better and better. If someone needs more one
should have to use batik which supports nearly everything but its java. 

I already thoght about adding a directive where a user could switch
between Image::Magick and batik as the Serializer. 
Still at the moment my  images are not too complex Image::Magick is my
first choice.

> 
> > 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:
> 

At this point I'll use simply PerlSetVar but I'll think about the
pnote-thing.

> > 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 ) = @_;
> 

Good point. I've already thought about that. Still I first have to learn
how I can built a CPAN-Module which I've never done before.

> 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;

At the end some examples:
http://ferrum.bestsolution.at/perl/testSvgSerializer/barChart.png
http://ferrum.bestsolution.at/perl/testSvgSerializer/drawings/bear.drawSWF
http://ferrum.bestsolution.at/perl/testSvgSerializer/drawings/face.drawSWF
http://ferrum.bestsolution.at/perl/testSvgSerializer/drawings/hallo.drawSWF
http://ferrum.bestsolution.at/perl/testSvgSerializer/drawings/text.drawSWF

The files .drawSWF are created using drawswf.sf.net a simply drawing
application which lets you create drawings and export them to Flash. As
internal storage format it uses very ***simple*** SVG without.

And that's what's next on my list after having finished my
SVG-Serializer:
Writing a Serializer which converts the drawSWF-Files into real
Flash-Files.

bye

tom

-- 
b e s t s o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
Thomas Schindl            Project Management   mobile ++43/664/314 59 58
------------------------------------------------------------------------
Anton-Rauch-Str.6a        A-6020 Innsbruck     fax       ++43/512/935834
http://www.bestsolution.at                     phone     ++43/512/935834

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to