Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5787

LCMS error 13: Mismatched alpha channels

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.2 PDFBox
    • 2.0.31, 3.0.3 PDFBox, 4.0.0
    • Rendering
    • None

    Description

      Using Kotlin to load the first page and trying to render it as an `BufferedImage`:

      ```kotlin
      val pdf = Loader.loadPDF(file)
      val preview = PDFRenderer(pdf).renderImage(0, 1.0f)
      ```

      with a PDF, I'm running into:

      ```
      Exception in thread "main" java.awt.color.CMMException: LCMS error 13: Mismatched alpha channels
          at java.desktop/sun.java2d.cmm.lcms.LCMS.createNativeTransform(Native Method)
          at java.desktop/sun.java2d.cmm.lcms.LCMS.createTransform(LCMS.java:113)
          at java.desktop/sun.java2d.cmm.lcms.LCMSTransform.doTransform(LCMSTransform.java:114)
          at java.desktop/sun.java2d.cmm.lcms.LCMSTransform.colorConvert(LCMSTransform.java:149)
          at java.desktop/java.awt.image.ColorConvertOp.ICCBIFilter(ColorConvertOp.java:350)
          at java.desktop/java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:277)
          at org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toRGBImageAWT(PDColorSpace.java:375)
          at org.apache.pdfbox.pdmodel.graphics.color.PDDeviceCMYK.toRGBImageAWT(PDDeviceCMYK.java:212)
          at org.apache.pdfbox.pdmodel.graphics.color.PDDeviceCMYK.toRGBImage(PDDeviceCMYK.java:159)
          at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from8bit(SampledImageReader.java:506)
          at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:217)
          at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:477)
          at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:438)
          at org.apache.pdfbox.rendering.PageDrawer.drawImage(PageDrawer.java:1106)
          at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:74)
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:893)
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:531)
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:506)
          at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:153)
          at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:286)
          at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:330)
          at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:247)
          at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:207)
      ```

      Would it be possible to somehow privately share the PDF? It's slightly sensitive as it is from a customer of mine and I would not want to share it publicly. 

      Attachments

        1. Screenshot 2024-03-19 at 23.17.32.png
          685 kB
          Niklas
        2. CGATS001Compat-v2-micro.icc
          8 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            vanniktech Niklas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: