GVS Srinivas wrote:

i managed to get the jpeg transcoder working by just setting the KEY_AOI to
the exact size of the bounding box of my view on the canvass.earlier ,since
i didnt mention the AOI ,i presume that batik is trying to convert the whole
canvas into jpeg image which is blowing up memory.i am not very sure.  but now
that problem is resolved,but i need to the BBox size from the document.

So Batik will normally rasterize the BBox to "fill" the width/height attributes. You can easily override this by providing your own width/height transcoder key. I suspect this is all you are doing with your AOI key.

now i have a small requirement i am passing the transcode input as a String Reader.
i want to set the AOI by getting the BBox of the SVG document.is there
anyway i can get the reference to svgdocument,before i call the transcode
function of  jpegtranscoder.
to get the boundingbox size i dont want to reparse the document again,as i
know that batik already does that.
is there any way i can access the dom structure from batik??

As I said above this is what is currently done. However, you can parse the SVG with any old XML parser, this is probably the most efficent route (as it will generate a Batik DOM) - The Parser can be any SAX2 parser (Xercex, Crimson, etc).

DocumentFactory df = new SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
document = f.createDocument(svg_ns, "svg", URI, inputStream);

   Then you can pass the 'preparsed' Document as one of the InputSource
types.


-----Original Message-----
From: Thomas DeWeese [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 8:56 PM
To: Batik Users
Subject: Re: out of memory


Hi Techno,


    This is pretty close, but I would use the getDefaultJPEGEncodeParam
that takes a number of bands:

jpegColorID = com.sun.image.codec.jpeg.JPEGDecodeParam.COLOR_ID_YCbCr;
jpegEncodeParam =
com.sun.image.codec.jpeg.JPEGCodec.getDefaultJPEGEncodeParam
                       (im.getSampleModel().getNumBands(), jpegColorID);



techno info wrote:


hi thomas,
correct if i am wrong,is this way i create???.
/*
jpegColorID =


com.sun.image.codec.jpeg.JPEGDecodeParam.COLOR_ID_YCbCr;


Raster tile00 = im.getTile(0, 0);

jpegEncodeParam =

com.sun.image.codec.jpeg.JPEGCodec.getDefaultJPEGEncodeParam(


                   tile00, jpegColorID);
*/

On Thu, 23 Oct 2003 Thomas DeWeese wrote :


techno info wrote:



i am facing with similar problem of memory outburst when i try to convert

svg to jpg. i tried the solution mentioned by you earlier


to GVS.infact i am getting a null pointer exception. In the encode
method of TIFFImageEncoder,it is calling encodeParam.getJPEGEncodeParam()

to get the JPEGEncodeParam.the value of JPEGEncodeParam is coming as null.


So did you try providing a JPEGEncodeParam?
As I said I've never actually used these TIFF formats.



/*
Exception breakpoint occurred at line 441 of TIFFImageEncoder.java.
java.lang.NullPointerException: java.lang.NullPointerException int

org.apache.batik.ext.awt.image.codec.tiff.TIFFImageEncoder.encode(java.awt.i mage.RenderedImage, org.apache.batik.ext.awt.image.codec.tiff.TIFFEncodeParam, int, boolean) TIFFImageEncoder.java:441 void org.apache.batik.ext.awt.image.codec.tiff.TIFFImageEncoder.encode(java.awt.i mage.RenderedImage) TIFFImageEncoder.java:164 void org.apache.batik.apps.tiledTranscoder.TiledImageTranscoder.transcode(org.w3c .dom.Document, java.lang.String, org.apache.batik.transcoder.TranscoderOutput) TiledImageTranscoder.java:76 void org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(org.apache.batik .transcoder.TranscoderInput, org.apache.batik.transcoder.TranscoderOutput) XMLAbstractTranscoder.java:174 void org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(org.apache.batik .transcoder.TranscoderInput, org.apache.batik.transcoder.TranscoderOutput) SVGAbstractTranscoder.java:188


*/







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








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


_____________________________________________________________________ This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com

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





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



Reply via email to