-
Bug
-
Resolution: Fixed
-
P3
-
8u40, 9
-
b153
-
x86
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8244304 | openjdk8u262 | Philip Race | P3 | Resolved | Fixed | b02 |
JDK-8239106 | 8u261 | Kumar Abhishek | P3 | Resolved | Fixed | b01 |
JDK-8246964 | emb-8u261 | Alexey Ivanov | P3 | Resolved | Fixed | team |
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Create a child raster by createWritableChild with an x-offset and contains the bottom-right pixel. Then AffineTransformOp filter produce an ImagingOpException.
If x-offset is 0 or the child raster doesn't contains the bottom-right pixel, the filter works well.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.awt.image.ImagingOpException: Unable to transform src image
at java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:358)
at TestAffineOp3.main(TestAffineOp3.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.geom.AffineTransform;
import java.awt.image.*;
public class TestAffineOp3 {
public static void main(String args[])
{
WritableRaster srcRaster, dstRaster;
DataBuffer db;
AffineTransform at = new AffineTransform();
at.setToScale(4.0, 4.0);
AffineTransformOp ato =
new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
// UShort pixels
short[] shortPixels =
{ 1001, 1002, 1003, 1004,
2001, 2002, 2003, 2004,
3001, 3002, 3003, 3004,
4001, 4002, 4003, 4004 };
System.out.println(shortPixels.length);
for (int j = 0, k = 0; j < 4; j++)
{
for (int i = 0; i < 4; i++, k++)
System.out.print(shortPixels[k] + "\t");
System.out.println();
}
// source raster
db = new DataBufferUShort(shortPixels, shortPixels.length);
int[] offsets = {0};
srcRaster = Raster.createInterleavedRaster(db, 4, 4, 4, 1,
offsets, null);
// writable child raster
srcRaster = srcRaster.createWritableChild(1, 1, 3, 3, 0, 0, null);
// destination raster
dstRaster = ato.filter(srcRaster, null);
db = dstRaster.getDataBuffer();
shortPixels = ((DataBufferUShort)db).getData();
System.out.println(shortPixels.length);
for (int j = 0, k = 0; j < 12; j++)
{
for (int i = 0; i < 12; i++, k++)
System.out.print(shortPixels[k] + "\t");
System.out.println();
}
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8239106 [macosx] AffineTransformOp can't handle child raster with non-zero x-offset
- Resolved
-
JDK-8244304 [macosx] AffineTransformOp can't handle child raster with non-zero x-offset
- Resolved
-
JDK-8246964 [macosx] AffineTransformOp can't handle child raster with non-zero x-offset
- Resolved
- duplicates
-
JDK-8229346 SVG images failing to display due to ImagingOpException in java.awt.image.AffineTransformOp
- Closed
- relates to
-
JDK-8172559 [PIT][TEST_BUG] Move @test to be 1st annotation in java/awt/image/Raster/TestChildRasterOp.java
- Resolved
-
JDK-8177393 Result of RescaleOp for 4BYTE_ABGR images may be 25% black
- Closed