Image convolve

C

Chase Preuninger

BufferedImage source = (BufferedImage)super.generate(text);
BufferedImageOp op = new ConvolveOp(new Kernel(3, 3, matrix));
BufferedImage dest = op.createCompatibleDestImage(source,
source.getColorModel());
op.filter(source, dest);

Exception in thread "main" java.awt.image.ImagingOpException: Unable
to convolve src image
at java.awt.image.ConvolveOp.filter(Unknown Source)
at BlurredTextImageGenerator.generate(BlurredTextImageGenerator.java:
25)
at Program.main(Program.java:6)

Why wont this work?
 
R

Roedy Green

Unable
to convolve src image

see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4957775

It gives a hint of a way around the problem. This is bug report from
JDK 1.4 days.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"If people become accustomed to lying, they will unconsciously commit every possible wrong deed. Before they can act wickedly, they must lie, and once they begin to lie they will act wickedly without concern."
~ Gautama Buddha
 
R

Roedy Green

Unable
to convolve src image

see http://kickjava.com/src/java/awt/image/ConvolveOp.java.htm

For the source code generating the Exception.

The line of interest is:

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

Unfortunately they don't post the source for ImagingLib.filter
--
Roedy Green Canadian Mind Products
http://mindprod.com

"If people become accustomed to lying, they will unconsciously commit every possible wrong deed. Before they can act wickedly, they must lie, and once they begin to lie they will act wickedly without concern."
~ Gautama Buddha
 
J

John B. Matthews

Roedy Green said:
see http://kickjava.com/src/java/awt/image/ConvolveOp.java.htm

For the source code generating the Exception.

The line of interest is:

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

Unfortunately they don't post the source for ImagingLib.filter

It looks like a sanity check: "If the implementing class cannot handle
the op, tile format or image format, the method will return null...":

<http://www.docjar.com/html/api/sun/awt/image/ImagingLib.java.html>
 
R

Roedy Green

Exception in thread "main" java.awt.image.ImagingOpException: Unable
to convolve src image

Here is something to try. Load the image up in PSP or similar imaging
utility. Then do a SAVE AS. This will normalise the image getting rid
of any quirky encoding, missing critical fields etc.

That will also ensure you have the correct extension.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Everybody’s worried about stopping terrorism. Well, there’s a really easy way: stop participating in it."
~ Noam Chomsky
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top