Browse Source

FOP-2336 OOM for tiff output

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1590653 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_0
Simon Steiner 10 years ago
parent
commit
040e4a7bbe

+ 3
- 2
src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java View File

@@ -229,7 +229,9 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin
}

//Set up bitmap to paint on
this.currentImage = createBufferedImage(bitmapWidth, bitmapHeight);
if (currentImage == null || currentImage.getWidth() != bitmapWidth || currentImage.getHeight() != bitmapHeight) {
currentImage = createBufferedImage(bitmapWidth, bitmapHeight);
}
Graphics2D graphics2D = this.currentImage.createGraphics();

// draw page background
@@ -316,7 +318,6 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin
this.multiImageWriter.writeImage(this.currentImage,
getSettings().getWriterParams());
}
this.currentImage = null;
} catch (IOException ioe) {
throw new IFException("I/O error while encoding BufferedImage", ioe);
}

Loading…
Cancel
Save