cropTask.setAlbumId(albumId);
cropTask.setUserId(spotId);
cropTask.setOffsetX(x);
cropTask.setOffsetY(y);
cropTask.setCropSize(size);
ImageCropResult cropResult;
try {
cropResult = crop.processImage(basePath, cropTask);
} catch (IOException e) {
throw new OperateFailedException("无法剪切图片");
}
if (cropResult == null || cropResult.getResultState() != ResultState.SUCCESS) {
throw new OperateFailedException("无法剪切图片,原因:"
+ (cropResult == null ? null : cropResult.getResultState()));
}
String portraitFile = cropResult.getFileKey();
spotService.updateSpotPortrait(spotId, portraitFile);
// personalInfoService.changeUserPortrait(ownerId, portraitFile);
// spot.setPortrait(portraitFile);
WebHelper.setSessionAttribute(null, Constant.SESSION_USER, user);