You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Litton, Tom - CEPM" <To...@cepm-us.com> on 2005/02/02 16:39:34 UTC

Retrieving the image height.

Hello all,

What is the most efficient way of retrieving the image height from the DOM object?

I've implemented my own transcoder which delegates to one of several other transcoders.  However, before the delegation takes place I need to do some calculations based on  the height of the image.  

Currently i'm calling transcode(document, s, transcoderoutput) on the super class (SVGAbstractTranscoder), but that seems like a very inefficient thing to do just to get the height.

Thanks,

Tom

Re: New to SVGWorld

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Vijay,

    I would recommend everyone upgrade from 1.1 to 1.5.x.
There are a lot of bugs, memory leaks and conformance issues
fixed in 1.5.1.  The biggest difference between 1.1 and 1.5.1
is that 1.5.1 supports dynamic SVG however if you aren't using
this you won't pay any significant price for it.

    I'm not sure what the problem is with your SVG file can you
be more specific (small example, or description of why it doesn't
render)?

Vijay.Varma-EXT@jci.com wrote:

> Can anyone explain me what was the advantages in batik1.5.I am new to 
> SVG world.Can anyone please help me.Here in our porject we are using 
> batik 1.1.But the file to parse and renderer it talking more Can anyone 
> advice me how to renderer the svg file.
> thanks,
> Vijay


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


New to SVGWorld

Posted by Vi...@jci.com.
Hi,
Can anyone explain me what was the advantages in batik1.5.I am new to SVG 
world.Can anyone please help me.Here in our porject we are using batik 
1.1.But the file to parse and renderer it talking more Can anyone advice 
me how to renderer the svg file.
thanks,
Vijay



Thomas.DeWeese@Kodak.com 
02/02/2005 08:24 PM
Please respond to
batik-users@xml.apache.org


To
batik-users@xml.apache.org
cc

Subject
Re: Retrieving the image height.






Litton, Tom - CEPM wrote:

> What is the most efficient way of retrieving the image height from the 
> DOM object?

    SVG is a scalable format so you need to define 'height'?
If your content is 'well behaved' you should be able to just
ask for the width/height attributes on the root element.

    The transcoder allows one to override these with hints
which you could also query.

> I've implemented my own transcoder which delegates to one of several 
> other transcoders.  However, before the delegation takes place I need to 

> do some calculations based on  the height of the image. 
> 
> Currently i'm calling transcode(document, s, transcoderoutput) on the 
> super class (SVGAbstractTranscoder), but that seems like a very 
> inefficient thing to do just to get the height.

     Well this depends, most of the transcoders need to do that
before they can output the image.  So what might be best would
be to subclass the transcoders you are delegating to so you can
insert your computations between when they call the parent
transcode method and when they actually create their output.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org



Re: Retrieving the image height.

Posted by Thomas DeWeese <Th...@Kodak.com>.
Litton, Tom - CEPM wrote:

> What is the most efficient way of retrieving the image height from the 
> DOM object?

    SVG is a scalable format so you need to define 'height'?
If your content is 'well behaved' you should be able to just
ask for the width/height attributes on the root element.

    The transcoder allows one to override these with hints
which you could also query.

> I've implemented my own transcoder which delegates to one of several 
> other transcoders.  However, before the delegation takes place I need to 
> do some calculations based on  the height of the image. 
> 
> Currently i'm calling transcode(document, s, transcoderoutput) on the 
> super class (SVGAbstractTranscoder), but that seems like a very 
> inefficient thing to do just to get the height.

     Well this depends, most of the transcoders need to do that
before they can output the image.  So what might be best would
be to subclass the transcoders you are delegating to so you can
insert your computations between when they call the parent
transcode method and when they actually create their output.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org