« Return to Thread: Crop operation never returns

Crop operation never returns

by spamania :: Rate this Message:

Reply to Author | View in Thread

Hi all,

I have JAI working OK for the most part, but I'm having a problem cropping images using JAI.create().  Here are the steps I'm taking:

1. Read image file from stream into a RenderedOp: RenderedOp image = JAI.create("stream", is);

2. Create the parameter block (hard-coded w/h values for testing):

ParameterBlockJAI params = new ParameterBlockJAI("crop");
params.addSource(image);

params.setParameter("x", image.getMinX());
params.setParameter("y", image.getMinY());
params.setParameter("width", 50);
params.setParameter("height", 50);

3. Create the crop operation: RenderedOp croppedImage = JAI.create("crop", params, null);

4. Save image

These steps work perfectly fine for scale operations, but the call to JAI.create(...) in step three never returns -- my application hangs and I need to abort it.

I am running on Mac OS X 10.5.2 Tiger.  I found one person complaining of a similar problem with ROI operations on Mac, but I haven't found any solutions or workarounds.

Any ideas?

Thanks a million.
nate

 « Return to Thread: Crop operation never returns