Bug 43120 - TIFFImage constructor failed with error "java.lang.NullPointerException" on image with CCITT 3 or 4 compression type
Summary: TIFFImage constructor failed with error "java.lang.NullPointerException" on i...
Status: RESOLVED FIXED
Alias: None
Product: XMLGraphicsCommons - Now in Jira
Classification: Unclassified
Component: image codecs (show other bugs)
Version: 1.2
Hardware: All All
: P2 normal (vote)
Target Milestone: --
Assignee: XML Graphics Project Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-14 06:32 UTC by Sergey Orlov
Modified: 2007-10-08 09:11 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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