Author: ssteiner
Date: Mon Apr 28 14:24:22 2014
New Revision: 1590653
URL: http://svn.apache.org/r1590653
Log:
FOP-2336 OOM for tiff output
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java?rev=1590653&r1=1590652&r2=1590653&view=diff
==============================================================================
---
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
(original)
+++
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java
Mon Apr 28 14:24:22 2014
@@ -229,7 +229,9 @@ public abstract class AbstractBitmapDocu
}
//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 AbstractBitmapDocu
this.multiImageWriter.writeImage(this.currentImage,
getSettings().getWriterParams());
}
- this.currentImage = null;
} catch (IOException ioe) {
throw new IFException("I/O error while encoding BufferedImage",
ioe);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]