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

invalid ICC Profile when reading from a byte array

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 1.8.10, 2.0.0
    • Fix Version/s: 1.8.10, 2.0.0
    • Component/s: Preflight
    • Labels:
      None
    • Environment:
      W7
      java version "1.7.0_79"
      Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

      Description

      6-1-12-t02-fail-a.pdf has 4 extra fails, that are related to an "invalid" ICC profile. "Invalid" meaning that ICC_Profile.getInstance() fails. Funny thing is that it works when reading from a stream. The following code shows this:

              FileInputStream fis = new FileInputStream(new File("veraPDF test suite 6-1-12-t02-fail-a.icc"));
              ICC_Profile instance = ICC_Profile.getInstance(fis);
              fis.close();
              File iccFile;
              FileInputStream fis2 = new FileInputStream(iccFile = new File("veraPDF test suite 6-1-12-t02-fail-a.icc"));
              byte[] iccBuf = new byte[(int) iccFile.length()];
              fis2.read(iccBuf);
              ICC_Profile instance2 = ICC_Profile.getInstance(iccBuf); // exception
              fis2.close();
      

      That is a java bug

      So I'll have to replace the calls in preflight accordingly. It doesn't apply to the main pdfbox project.

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: