poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 52078] Slide.draw throws java.lang.OutOfMemoryError in some slides with grouped shapes
Date Tue, 13 Nov 2012 13:42:47 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52078

--- Comment #4 from Mariano <nicolas_metal04@hotmail.com> ---
OK, i saw it, but i don't understand how can I get the Picture object(parent)
in BitmapPainter.paint(Graphics2D graphics, PictureData pict, Picture parent)
method?
I put my method that returns a list of strings(the BufferedImage converted in
base64) --> one string for one slide

/***************************************************/
private List<String> obtainSlidesFromPPT(InputStream is) {
    SlideShow ppt = null;
    List<String> returnList = new LinkedList<String>();
    try {
        ppt = new SlideShow(is);
        is.close();
        Dimension pgsize = ppt.getPageSize();
        PictureData [] pd = ppt.getPictureData();
        int nSlides = pd.length;
        for (int i = 0; i < nSlides; i++) {
            PictureData pict = pd[i];
            BufferedImage img = ImageIO.read(new
ByteArrayInputStream(pict.getData()));
            Graphics2D graphics = img.createGraphics();
            //Rectangle anchor = parent.getLogicalAnchor2D().getBounds();
             graphics.drawImage(img, anchor.x, anchor.y, anchor.width,
anchor.height, null);
            graphics.dispose();               
returnList.add(covertBufferedImageInBase64String(img));        
            }
        } catch (IOException ioe) {
            System.err.println(ioe.getMessage());
        }
        return returnList;
    }
/***************************************************/


(In reply to comment #3)
> Did you try the latest build from trunk? Does it still throw OutOfMemory for
> the attached file?
> 
> (In reply to comment #2)
> > Why Status is RESOLVED? I didn't find the solution!
> > Please, can show me?
> > 
> > Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message