createScaledRendering weird problem when create small thumbnail
From: xj92wang_at_hotmail.com (xj92wang_at_yahoo.com)
Date: 06/28/04
- Next message: Aaron Davies: "Re: Problem with imageio: ImageReader stalls on JPEGs at ~95%"
- Previous message: Eki Y. Baskoro: "Re: Setting an array in JSP with resultset data from a javabean"
- Next in thread: Roedy Green: "Re: createScaledRendering weird problem when create small thumbnail"
- Reply: Roedy Green: "Re: createScaledRendering weird problem when create small thumbnail"
- Reply: xj92wang_at_hotmail.com: "Re: createScaledRendering weird problem when create small thumbnail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Jun 2004 07:44:53 -0700
I have following code to convert a big image to smaller thumbnail,
it work's fine until one day this image come out
http://www.here4now.com/mobdata/sunbleached/Untitled-2.gif
The original size is 200x205, if I resize it to 101x103, it looks
still fine, but one pixed smaller , say 100x102, the result image is
total unacceptable.
Any help or hint will be appreciate
Ivan Wang
P.S. I didn't use Image.getScaledInstance to resize the image because
our server don't have X-window installed.
/*******************************************************************/
public static void resize(String file1, String file2){
source = JAI.create("fileload", file1);
ParameterBlock pb = new ParameterBlock();
pb.addSource(source);
pb.add(null).add(null).add(null).add(null).add(null);
RenderableImage ren = JAI.createRenderable("renderable", pb);
pb = new ParameterBlock();
pb.addSource(ren);
int w = source.getWidth()/2;
int h = source.getHeight()/2;
//RenderingHints renderingHints = new RenderingHints( null );
//renderingHints.put( RenderingHints.KEY_COLOR_RENDERING,
// RenderingHints.VALUE_COLOR_RENDER_QUALITY );
PlanarImage dst = (PlanarImage)ren.createScaledRendering(w, h,
null);
JAI.create("filestore",dst,file2,"PNG");
}
/*******************************************************************/
- Next message: Aaron Davies: "Re: Problem with imageio: ImageReader stalls on JPEGs at ~95%"
- Previous message: Eki Y. Baskoro: "Re: Setting an array in JSP with resultset data from a javabean"
- Next in thread: Roedy Green: "Re: createScaledRendering weird problem when create small thumbnail"
- Reply: Roedy Green: "Re: createScaledRendering weird problem when create small thumbnail"
- Reply: xj92wang_at_hotmail.com: "Re: createScaledRendering weird problem when create small thumbnail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|