From batik-users-return-17237-apmail-xmlgraphics-batik-users-archive=xmlgraphics.apache.org@xmlgraphics.apache.org Sat Mar 9 12:13:24 2013 Return-Path: X-Original-To: apmail-xmlgraphics-batik-users-archive@www.apache.org Delivered-To: apmail-xmlgraphics-batik-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D59FFDFB0 for ; Sat, 9 Mar 2013 12:13:24 +0000 (UTC) Received: (qmail 49379 invoked by uid 500); 9 Mar 2013 12:13:24 -0000 Delivered-To: apmail-xmlgraphics-batik-users-archive@xmlgraphics.apache.org Received: (qmail 49152 invoked by uid 500); 9 Mar 2013 12:13:20 -0000 Mailing-List: contact batik-users-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: batik-users@xmlgraphics.apache.org Delivered-To: mailing list batik-users@xmlgraphics.apache.org Delivered-To: moderator for batik-users@xmlgraphics.apache.org Received: (qmail 93211 invoked by uid 99); 7 Mar 2013 16:07:18 -0000 X-ASF-Spam-Status: No, hits=3.0 required=5.0 tests=FORGED_YAHOO_RCVD,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Date: Thu, 7 Mar 2013 08:06:50 -0800 (PST) From: mihir To: batik-users@xmlgraphics.apache.org Message-ID: <1362672410162-4655495.post@n4.nabble.com> Subject: OutofMemory while reading JPEG file Using Apache Batik MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello All this is my first post to this forum. i have generated svg file, using following code, public class TestSVGGen { static BufferedImage img; public void paint(SVGGraphics2D g2d) { g2d.setPaint(Color.red); g2d.fill(new Rectangle(10, 10, 100, 100)); g2d.drawImage(img, 0, 0, img.getWidth() ,img.getHeight(), null); g2d.setSVGCanvasSize(new Dimension(img.getWidth(), img.getHeight())); } public static void main(String[] args) throws IOException { img = ImageIO.read(TestSVGGen.class.getClassLoader().getResourceAsStream("images/test_offscreen.jpg")); // Get a DOMImplementation. DOMImplementation domImpl = GenericDOMImplementation .getDOMImplementation(); // Create an instance of org.w3c.dom.Document. String svgNS = "http://www.w3.org/2000/svg"; Document document = domImpl.createDocument(svgNS, "svg", null); // Create an instance of the SVG Generator. SVGGraphics2D svgGenerator = new SVGGraphics2D(document); // Ask the test to render into the SVG Graphics2D implementation. TestSVGGen test = new TestSVGGen(); test.paint(svgGenerator); // Finally, stream out SVG to the standard output using // UTF-8 encoding. boolean useCSS = true; // we want to use CSS style attributes File file = new File("image.svg"); FileOutputStream fos = new FileOutputStream(file); Writer out = new OutputStreamWriter(fos, "UTF-8"); svgGenerator.stream(out, useCSS); } now , i want to re size this image canvas to 18,000 * 18000 in dimensions because i want to re size included image to this size , but whenever i try the following code (only portion of the code) svgCanvas.setSize(new Dimension(18000, 18000)); the program throws out of memory exception, what should i do to re size to specified large size , is there any work around like tiling or segmentation of image . i am very new to batik so please help me -- View this message in context: http://batik.2283329.n4.nabble.com/OutofMemory-while-reading-JPEG-file-Using-Apache-Batik-tp4655495.html Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org