-
Bug
-
Resolution: Duplicate
-
P4
-
8, 11, 16, 17
-
None
I trying to catch the reason of CMMException which are randomly thrown here and there.
The ColorConvertOp may fail to use the icc profile if profile tags data was updated.
The steps to reproduce:
1. Create the profile and update one of its tag
2. Try to use the profile by the ColorConvertOp
3. The CMMException will occur
4. It is interesting that if we will reread the data from the profile and create a new profile for that data, the ColorConvertOp will work fine
The root cause is in the LCMS.c#_writeCookedTag method:
1. We create a temporary profile:
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L741
2. We update all tags in that profile.
3. We save and read back that profile:
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L813
4. We check that the profile from step 3 contains the new data for the tag
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L826
5. And then we return the temporary profile, instead of validated one
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L837
And this is the reason why the new profile created on top of the "old" data works fine, since that include the cmsSaveProfileToMem/cmsOpenProfileFromMem steps.
The ColorConvertOp may fail to use the icc profile if profile tags data was updated.
The steps to reproduce:
1. Create the profile and update one of its tag
2. Try to use the profile by the ColorConvertOp
3. The CMMException will occur
4. It is interesting that if we will reread the data from the profile and create a new profile for that data, the ColorConvertOp will work fine
The root cause is in the LCMS.c#_writeCookedTag method:
1. We create a temporary profile:
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L741
2. We update all tags in that profile.
3. We save and read back that profile:
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L813
4. We check that the profile from step 3 contains the new data for the tag
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L826
5. And then we return the temporary profile, instead of validated one
https://github.com/openjdk/jdk/blob/9bc023220fbbb0b6ea1ed1a0ca2aa3848764e8cd/src/java.desktop/share/native/liblcms/LCMS.c#L837
And this is the reason why the new profile created on top of the "old" data works fine, since that include the cmsSaveProfileToMem/cmsOpenProfileFromMem steps.
- duplicates
-
JDK-8282577 ICC_Profile.setData(int, byte[]) invalidates the profile
- Resolved