]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
prevent npe
authorKeiron Liddle <keiron@apache.org>
Tue, 23 Jul 2002 10:59:09 +0000 (10:59 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 23 Jul 2002 10:59:09 +0000 (10:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195021 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/image/AbstractFopImage.java
src/org/apache/fop/image/analyser/TIFFReader.java

index 2b1dec82d549ab34083239079b03316cb096a5f4..7128ea9e409ff0bb1684f8c86f773ac1626bb72c 100644 (file)
@@ -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() {
index 8b5d5660aebb23f4b03204e40b06aab3d83064b0..b6ac2b3bb0c989228ca18008d3a91c53f3748ba3 100644 (file)
@@ -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 {