InputStream in = null;
ImageWrapper srcImageWrapper = null;
ImageRender rr = null;
try {
in = new FileInputStream(new File(path, "cb.GIF"));
rr = new ReadRender(in, true);
srcImageWrapper = rr.render();
} finally {
if (rr != null) {
rr.dispose();
}
IOUtils.closeQuietly(in);
}
int width = srcImageWrapper.getWidth();
int height = srcImageWrapper.getHeight();
ImageWrapper wmImage = null;
ImageRender sr = null;
try {
in = new FileInputStream(new File(path, "alibaba1.gif"));
rr = new ReadRender(in, false);
sr = new ScaleRender(rr, new ScaleParameter(width, height, ScaleParameter.Algorithm.SUBSAMPLE_AVG));
wmImage = sr.render();
} finally {
if (sr != null) {
sr.dispose();