-
Bug
-
Resolution: Fixed
-
P4
-
6, 11, 17
-
b26
-
x86
-
windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8303314 | 17.0.8-oracle | Maheshkumar Bollapragada | P4 | Resolved | Fixed | b01 |
JDK-8301103 | 17.0.7 | Sergey Bylokhov | P4 | Resolved | Fixed | b01 |
JDK-8303313 | 11.0.20-oracle | Maheshkumar Bollapragada | P4 | Resolved | Fixed | b01 |
JDK-8301105 | 11.0.19 | Sergey Bylokhov | P4 | Resolved | Fixed | b01 |
JDK-8315133 | openjdk8u402 | Sergey Bylokhov | P4 | Resolved | Fixed | b01 |
JDK-8303315 | 8u381 | Maheshkumar Bollapragada | P4 | Resolved | Fixed | b01 |
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
sRGB-ColorSpace to sRGB-ColorSpace Conversion in JAVA6 has improved in comparision to JAVA5, but it is still erroneous.
Included testcase should create a pure white color, but green-component is 254 instead of 255.
---
ColorSpace cspace = ColorSpace.getInstance( ColorSpace.CS_sRGB );
float fvalue[] = new float[] { 1.0f, 1.0f, 1.0f };
Color c = new Color( cspace, fvalue, 1.0f );
System.out.println( c );//should be "java.awt.Color[r=255,g=255,b=255]"
float frgbvalue[] = cspace.toRGB( fvalue );
for( int i = 0; i < 3; ++i )
System.out.println( fvalue[i] + " -> " + frgbvalue[i] );//should always be "1.0 -> 1.0"
---
Results for JAVA6 (1.6.0):
java.awt.Color[r=255,g=254,b=255]
1.0 -> 1.0
1.0 -> 0.99998474
1.0 -> 1.0
Results for JAVA5 (1.5.0_10):
java.awt.Color[r=251,g=253,b=253]
1.0 -> 0.98770124
1.0 -> 0.9933623
1.0 -> 0.99574274
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class ColorSpaceTest
{
public static void main( String[] args )
{
ColorSpace cspace = ColorSpace.getInstance( ColorSpace.CS_sRGB );
float fvalue[] = new float[] { 1.0f, 1.0f, 1.0f };
Color c = new Color( cspace, fvalue, 1.0f );
System.out.println( c );
float frgbvalue[] = cspace.toRGB( fvalue );
for( int i = 0; i < 3; ++i )
System.out.println( fvalue[i] + " -> " + frgbvalue[i] );
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8301103 sRGB-ColorSpace to sRGB-ColorSpace Conversion
- Resolved
-
JDK-8301105 sRGB-ColorSpace to sRGB-ColorSpace Conversion
- Resolved
-
JDK-8303313 sRGB-ColorSpace to sRGB-ColorSpace Conversion
- Resolved
-
JDK-8303314 sRGB-ColorSpace to sRGB-ColorSpace Conversion
- Resolved
-
JDK-8303315 sRGB-ColorSpace to sRGB-ColorSpace Conversion
- Resolved
-
JDK-8315133 sRGB-ColorSpace to sRGB-ColorSpace Conversion
- Resolved
- links to
-
Commit openjdk/jdk8u-dev/79cae436
-
Commit openjdk/jdk11u-dev/c02f7fea
-
Commit openjdk/jdk17u-dev/b3a8ad57
-
Commit openjdk/jdk/abeddab9
-
Review openjdk/jdk8u-dev/354
-
Review openjdk/jdk11u-dev/1677
-
Review openjdk/jdk17u-dev/1095
-
Review openjdk/jdk/11250