final ICompress jp2 = new KduCompressExe();
final File jp2Local = File.createTempFile("cache" + uri.hashCode() + "-", ".jp2");
if (!jp2Local.delete() && LOGGER.isWarnEnabled()) {
LOGGER.warn("File not deleted: {}", jp2Local);
}
jp2.compressImage(img.getAbsolutePath(), jp2Local.getAbsolutePath(), new DjatokaEncodeParam());
if (!img.delete() && LOGGER.isWarnEnabled()) {
LOGGER.warn("File not deleted: {}", img);
}
img = jp2Local;
} else {