From 42c14d6c02efdbdf41ed828a6f44941965a83f3a Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 7 Feb 2007 11:44:49 +0000 Subject: Bugzilla #41488: Fix for NPE with PNG images for RTF output. Support for GIF images in RTF output (RTF handler, only. Does not affect the RTF library.). Reverts revision 503326 and fixes the problem in a different way. But the fix is only a work-around and will need to be revisited when redesigning the image package. At any rate, the resolution problem introduced with the previous patch can been avoided with the new approach. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@504511 13f79535-47bb-0310-9956-ffa450edef68 --- src/java-1.4/org/apache/fop/image/ImageIOImage.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/java-1.4') diff --git a/src/java-1.4/org/apache/fop/image/ImageIOImage.java b/src/java-1.4/org/apache/fop/image/ImageIOImage.java index 1af4f0b9a..7ec6b9004 100644 --- a/src/java-1.4/org/apache/fop/image/ImageIOImage.java +++ b/src/java-1.4/org/apache/fop/image/ImageIOImage.java @@ -64,10 +64,7 @@ public class ImageIOImage extends AbstractFopImage { * @see org.apache.fop.image.AbstractFopImage#loadDimensions() */ protected boolean loadDimensions() { - if ((this.width > 0) && (this.height > 0)) { - return true; - } - else if (this.bitmaps == null) { + if (this.bitmaps == null) { return loadBitmap(); } return true; @@ -211,7 +208,11 @@ public class ImageIOImage extends AbstractFopImage { /** @see org.apache.fop.image.AbstractFopImage#loadOriginalData() */ protected boolean loadOriginalData() { - return loadDefaultOriginalData(); + if (inputStream == null && getBitmaps() != null) { + return false; + } else { + return loadDefaultOriginalData(); + } } /** @see org.apache.fop.image.FopImage#hasSoftMask() */ -- cgit v1.2.3