Bug 43120

Summary: TIFFImage constructor failed with error "java.lang.NullPointerException" on image with CCITT 3 or 4 compression type
Product: XMLGraphicsCommons - Now in Jira Reporter: Sergey Orlov <sorlov>
Component: image codecsAssignee: XML Graphics Project Mailing List <general>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.2   
Target Milestone: --   
Hardware: All   
OS: All   

Description Sergey Orlov 2007-08-14 06:32:49 UTC
330:            int photometricType =
(int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_PHOTOMETRIC_INTERPRETATION);

Image has no field with tag "TIFFImageDecoder.TIFF_PHOTOMETRIC_INTERPRETATION".

I use next workaround:

            int photometricType;

            TIFFField photometricTypeField =
dir.getField(TIFFImageDecoder.TIFF_PHOTOMETRIC_INTERPRETATION);

            // Get the photometric interpretation.
            if (photometricTypeField == null)
              photometricType = 0; // White is zero
            else
              photometricType = photometricTypeField.getAsInt(0);
Comment 1 Jeremias Maerki 2007-10-08 09:11:07 UTC
Suggested work-around implemented. Thank you!
http://svn.apache.org/viewvc?rev=582858&view=rev