echosvg icon indicating copy to clipboard operation
echosvg copied to clipboard

ConvolveMatrix test fails with an ImagingOpException

Open carlosame opened this issue 3 years ago • 0 comments

The ConvolveMatrix test (rendering of samples/tests/spec/filters/feConvolveMatrix.svg in SamplesRenderingTest.testFilterFeConvolveMatrix()) fails with an exception:

java.awt.image.ImagingOpException: Unable to convolve src image

This bug is the same as BATIK-1280.

The problem happens at line 404 of io.sf.carte.echosvg.ext.awt.image.renderable.ConvolveMatrixRable8Bit:

    // Easy case just apply the op...
    destBI = op.filter(srcBI, null);

which calls java.awt.image.ConvolveOp.filter(BufferedImage, BufferedImage) and there (line 197):

if (ImagingLib.filter(this, src, dst) == null) {
    throw new ImagingOpException ("Unable to convolve src image");
}

Once in ImagingLib.filter we get into ImagingLib.convolveBI(BufferedImage, BufferedImage, Kernel, int) which is where it fails (line 259): it tests for the convolveBI result being greater than zero which is not the case, and then returns the null value which triggers the exception.

It is difficult to debug what is going on in ImagingLib.convolveBI because it is native code.

carlosame avatar Jun 05 '21 18:06 carlosame