JDK-6463111 : ConvolveOp(AffineTransformOp).filter() method fails on BufferedImage created by GC
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.0
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux
  • CPU: generic
  • Submitted: 2006-08-23
  • Updated: 2016-01-12
  • Resolved: 2016-01-12
Related Reports
Relates :  
Description
If we create BufferedImage-s using GraphicsConfiguration.createCompatibleImage() and pass then these images to ConvolveOp.filter() method, we got ImagingOpException (Unable to convolve src image). Please note that this test passes on Windows, but fails on Linux (RedHat, SuSE)/Solaris.

In order to reproduce this problem please use test in the attachment.

The output is following:
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[0]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x23]
Src Image: BufferedImage@1c1ea29: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@1f436f5
Src Image: BufferedImage@4413ee: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@1786e64
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[1]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x24]
Src Image: BufferedImage@100ab23: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@e3b895
Src Image: BufferedImage@6b7920: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@1dd46f7
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[2]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x25]
Src Image: BufferedImage@1f6f0bf: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@137c60d
Src Image: BufferedImage@ab853b: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@b82368
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[3]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x26]
Src Image: BufferedImage@eb017e: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@aeffdf
Src Image: BufferedImage@120a47e: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@f73c1
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[4]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x27]
Src Image: BufferedImage@13d93f4: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@1bca5f1
Src Image: BufferedImage@329f3d: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@1749757
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[5]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x28]
Src Image: BufferedImage@18ee9d6: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@19a0c7c
Src Image: BufferedImage@a9ae05: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@1dff3a2
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[6]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x29]
Src Image: BufferedImage@b42cbf: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@e5b723
Src Image: BufferedImage@15a8767: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@6f7ce9
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
--------------
Screen Device[0]: X11GraphicsDevice[screen=0]
GraphicsConfiguration[7]: X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x2a]
Src Image: BufferedImage@1feca64: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@998b08
Src Image: BufferedImage@76cbf7: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 sun.awt.image.WritableRasterNative@148cc8c
Unexpected: java.awt.image.ImagingOpException: Unable to convolve src image
java.awt.image.ImagingOpException: Unable to convolve src image
        at java.awt.image.ConvolveOp.filter(Unknown Source)
        at Test.main(Test.java:40)
Test failed

Comments
EVALUATION This problem seems to be yet another manifestation of the limitations of medialib glue code: the native procedure that handles Raster objects is not ready to work with instances of WritableRasterNative. Technically, native rasters can be handled by using the cvtCustomToDefault() (that extracts pixel valuesusing getRGB() method). So, we should consider changing glue code logic to use it for native rasters.
24-08-2006