iText 1.0 throws a NullPointerException if one tries to read a bilevel TIFF image
that does not contain the RowsPerStrip tag (278).
 
According to the TIIF 6.0 specification, pg. 39, RowsPerStrip is optional and has a
default value of 2**32-1.
 
The following trivial change fixes this.
 
/src/com/lowagie/text/pdf/codec/TiffImage.java
145c145,148
<             long tstrip = dir.getFieldAsLong(TIFFConstants.TIFFTAG_ROWSPERSTRIP);
---
>             long tstrip = 0xFFFFFFFFL;
>             if (dir.isTagPresent(TIFFConstants.TIFFTAG_ROWSPERSTRIP)) {
>                 tstrip = dir.getFieldAsLong(TIFFConstants.TIFFTAG_ROWSPERSTRIP);
>             }
 
Regards,
Ronald Dauster
 

Reply via email to