@Override
public void update(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
String directory = (String) parameters.get("directory");
String imageName = (String) parameters.get("image");
IImage image = new AWTImage(PathResolver.resolve("photos/"+directory+"/"+imageName, PhotosController.class));
image.rotate(getIntParameter(parameters.get("rotation")));
image.scale(getIntParameter(parameters.get("width")), getIntParameter(parameters.get("height")), true, true);
image.save();
try {
IImage thumbnailImage = new AWTImage(PathResolver.resolve("photos/"+directory+"/thumbnails/"+imageName, PhotosController.class));
thumbnailImage.rotate(getIntParameter(parameters.get("rotation")));