try {
JCRNodeWrapper node = session.getNode(path);
if (contentManager
.checkExistence(node.getPath().replace(node.getName(), target), session) &&
!forceReplace) {
throw new ExistingFileException("The file " + target + " already exists.");
}
Image image = imageService.getImage(node);
File f = File.createTempFile("image", null);
imageService.cropImage(image, f, top, left, width, height);