Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8282635

Test sun/java2d/cmm/ReadWriteProfileTest.java has problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • None
    • client-libs
    • None
    • 2d

      There is a fix in progress which resolves that ICC_Profile.setData(int, byte[] ) results in updating the native LCMS ref to be an unusable profile since it is raw.
          8282577: ICC_Profile.setData(int, byte[]) invalidates the profile
      With that fix sun/java2d/cmm/ReadWriteProfileTest.java fails due to various issues that aren't easily resolved, or may not be resolvable - the test assumptions may be guaranteed.

      it passes today because the returned profile is raw, just reflecting back what was set and the test is happy

      But after the fix for 8282577
      (1) The implementation validates what was set as a consequence of making it usable, and if this fails, it does not perform the update
      (2) The information to be used is being pulled raw from a very simple parsing of the ICC_Profile raw data for the entire file, skipping to the tags and pulling their data. If there's a problem with one of these tags, then we can hit (1).
      And it seems likely we have problems in some of the profiles.
      (3) The process of turning the raw data into "cooked" data means that when we later ask for the raw data back LCMS serializes it and as per comments in the LCMS docs this isn't guaranteed to be the same as the original.

      If "setData()" fails the test should just continue and not try to validate that it can read the same back since that is doomed.

      Probably this means there's a problem with the profile per the spec and we should be fixing the profiles, not the test.

      Comparing the returned tags may need to be filtered - text based tags at least do not seem to come back the same as they went in.

      Even if I skip cases where setData() fails we have multiple problems :
      Incorrect result of getData(int) with tag dmnd of sRGB profile
      Incorrect result of getData(int) with tag dmdd of sRGB profile
      Incorrect result of getData(int) with tag desc of sRGB profile
      Incorrect result of getData(int) with tag A2B0 of PYCC profile
      Incorrect result of getData(int) with tag bTRC of LINEAR_RGB profile
      Incorrect result of getData(int) with tag gTRC of LINEAR_RGB profile
      Incorrect result of getData(int) with tag rTRC of LINEAR_RGB profile
      Incorrect result of getData(int) with tag desc of LINEAR_RGB profile
      Incorrect result of getData(int) with tag A2B0 of CIEXYZ profile
      Incorrect result of getData(int) with tag dmnd of CIEXYZ profile
      Incorrect result of getData(int) with tag desc of CIEXYZ profile
      Incorrect result of getData(int) with tag pre0 of CIEXYZ profile
      Incorrect result of getData(int) with tag B2A0 of CIEXYZ profile
      Incorrect result of getData(int) with tag dmdd of CIEXYZ profile
      Incorrect result of getData(int) with tag dmnd of GRAY profile
      Incorrect result of getData(int) with tag desc of GRAY profile
      Incorrect result of getData(int) with tag dmdd of GRAY profile

      All of these were pre-existing and masked by returning a raw profile.

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: