diff options
author | Keiron Liddle <keiron@apache.org> | 2002-07-23 10:59:09 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-07-23 10:59:09 +0000 |
commit | fc2fd3bb3660bd20b349b21ba9f279512a3893cd (patch) | |
tree | f6314e9506e0b27a0f091f67ed392991ed558a88 | |
parent | 81812e2f472d4dd50714ad0a36a981c46705130e (diff) | |
download | xmlgraphics-fop-fc2fd3bb3660bd20b349b21ba9f279512a3893cd.tar.gz xmlgraphics-fop-fc2fd3bb3660bd20b349b21ba9f279512a3893cd.zip |
prevent npe
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195021 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/org/apache/fop/image/AbstractFopImage.java | 8 | ||||
-rw-r--r-- | src/org/apache/fop/image/analyser/TIFFReader.java | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/org/apache/fop/image/AbstractFopImage.java b/src/org/apache/fop/image/AbstractFopImage.java index 2b1dec82d..7128ea9e4 100644 --- a/src/org/apache/fop/image/AbstractFopImage.java +++ b/src/org/apache/fop/image/AbstractFopImage.java @@ -93,9 +93,11 @@ public abstract class AbstractFopImage implements FopImage { public AbstractFopImage(URL href, FopImage.ImageInfo info) { this.m_href = href; this.imageInfo = info; - this.m_width = this.imageInfo.width; - this.m_height = this.imageInfo.height; - loaded = loaded | DIMENSIONS; + if(this.imageInfo.width != -1) { + m_width = imageInfo.width; + m_height = imageInfo.height; + loaded = loaded | DIMENSIONS; + } } public String getMimeType() { diff --git a/src/org/apache/fop/image/analyser/TIFFReader.java b/src/org/apache/fop/image/analyser/TIFFReader.java index 8b5d5660a..b6ac2b3bb 100644 --- a/src/org/apache/fop/image/analyser/TIFFReader.java +++ b/src/org/apache/fop/image/analyser/TIFFReader.java @@ -77,7 +77,10 @@ public class TIFFReader implements ImageReader { * byte4 ); * this.height = ( int ) ( l ); */ - return null; + FopImage.ImageInfo info = new FopImage.ImageInfo(); + info.width = -1; + info.height = -1; + return info; } protected byte[] getDefaultHeader(BufferedInputStream imageStream) throws IOException { |