Uploaded image for project: 'XMLGraphicsCommons'
  1. XMLGraphicsCommons
  2. XGC-10

TIFFImage constructor failed with error "java.lang.NullPointerException" on image with CCITT 3 or 4 compression type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 1.2
    • None
    • image codecs
    • None
    • Operating System: All
      Platform: All

    Description

      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);

      Attachments

        Activity

          People

            general@xmlgraphics.apache.org XML Graphics Project Mailing List
            sorlov@mdi.ru Sergey Orlov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: