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

IllegalArgumentException loading a grayscale PNG with a CMYK color profile

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: image codecs
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      I've stumbled over a PNG that cannot be loaded by ImageLoaderImageIO because it contains an incompatible color profile. The profile is CMYK but the bitmap itself is grayscale plus alpha. That combination causes an IllegalArgumentException.

      java.lang.IllegalArgumentException: Raster ByteInterleavedRaster: width = 344 height = 2127 #numDataElements 1 dataOff[0] = 0 is incompatible with ColorModel ColorModel: #pixelBits = 32 numComponents = 4 color space = java.awt.color.ICC_ColorSpace@c61cd88 transparency = 1 has alpha = false isAlphaPre = false
      at java.awt.image.BufferedImage.<init>(BufferedImage.java:611)
      at org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO.loadImage(ImageLoaderImageIO.java:198)

        Attachments

          Activity

            People

            • Assignee:
              general@xmlgraphics.apache.org XML Graphics Project Mailing List
              Reporter:
              jeremias@apache.org Jeremias Maerki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: