File fileTarget = getExistingFile(targethash, dirCurrent, FileActionEnum.WRITE);
String mode = (String) getParamObject("mode");
if (mode.equals("resize")) {
int with = Integer.parseInt((String) getParamObject("width"));
int height = Integer.parseInt((String) getParamObject("height"));
ResampleOp resampleOp = new ResampleOp(with, height);
BufferedImage origImage;
try {
origImage = ImageIO.read(fileTarget);
String ext = FilenameUtils.getExtension(fileTarget.getName());
BufferedImage rescaledImage = resampleOp.filter(origImage, null);
ImageIO.write(rescaledImage, ext, fileTarget);
} catch (IOException rescaleEx) {
java.util.logging.Logger.getLogger(ResizeCommand.class.getName()).log(Level.SEVERE, null, rescaleEx);
}
} else if (mode.equals("crop")) {