my tiny application is supposed to resize images. a selected image. For some reason it required more than 256MB to resize the image applying the function below on a 8MB JPG file. Of course, I could broaden the memory scope for the application, but that seems to be the wrong approach - since macromedia fireworks requires less than 20MB RAM to resize the image in record time. Any guess how to minimize the memory eating? Any way to apply dynamic memory allocating.
thanks
public RenderedOp resize(PlanarImage planImg, float resizeFactor){
ParameterBlock pb = new ParameterBlock();
pb = new ParameterBlock();
pb.addSource(planImg);
pb.add(resizeFactor);
pb.add(resizeFactor);
pb.add(0.0f);
pb.add(0.0f);
pb.add(new InterpolationNearest());
RenderedOp img = JAI.create("scale", pb, null);
return img;
}
thanks
public RenderedOp resize(PlanarImage planImg, float resizeFactor){
ParameterBlock pb = new ParameterBlock();
pb = new ParameterBlock();
pb.addSource(planImg);
pb.add(resizeFactor);
pb.add(resizeFactor);
pb.add(0.0f);
pb.add(0.0f);
pb.add(new InterpolationNearest());
RenderedOp img = JAI.create("scale", pb, null);
return img;
}