public void doReadWrite(File in, File out, ImageFormat format) throws Exception {
doReadWrite(in, true, out, format);
}
public void doReadWrite(File in, boolean toRGB, File out, ImageFormat format) throws Exception {
WriteRender wr = null;
InputStream inStream = new FileInputStream(in);
try {
ReadRender rr = new ReadRender(inStream, toRGB);
wr = new WriteRender(rr, out, format);
wr.render();
} finally {
IOUtils.closeQuietly(inStream);
if(wr != null) {
wr.dispose();
}
}
}