keiron      2002/07/23 03:59:10

  Modified:    src/org/apache/fop/image AbstractFopImage.java
               src/org/apache/fop/image/analyser TIFFReader.java
  Log:
  prevent npe
  
  Revision  Changes    Path
  1.10      +6 -4      xml-fop/src/org/apache/fop/image/AbstractFopImage.java
  
  Index: AbstractFopImage.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/AbstractFopImage.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractFopImage.java     27 Jun 2002 11:45:54 -0000      1.9
  +++ AbstractFopImage.java     23 Jul 2002 10:59:09 -0000      1.10
  @@ -93,9 +93,11 @@
       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() {
  
  
  
  1.6       +5 -2      xml-fop/src/org/apache/fop/image/analyser/TIFFReader.java
  
  Index: TIFFReader.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/analyser/TIFFReader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TIFFReader.java   25 Feb 2002 09:31:03 -0000      1.5
  +++ TIFFReader.java   23 Jul 2002 10:59:09 -0000      1.6
  @@ -77,7 +77,10 @@
            * 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 {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to