r.setHeight(imageSize.Get_y());
r.setDWTLevels(minLevels);
channels.Native_destroy();
if (codestream.Exists())
codestream.Destroy();
kduIn.Native_destroy();
inputSource.Native_destroy();
jp2_family_in.Native_destroy();
} catch (KduException e) {
throw new DjatokaException(e);