}
List<ImageResizeResult> results = imagine.processImage(localStorePath, tasks);
List<ImageResizeResult> filesInfo = processResizeResult(results, message);
Album album = null;
try {
album = albumService.getAlbumForChange(albumId, ownerId);
} catch (Exception e) {
LOGGER.warn("获取相册失败", e);
result.put("success", Boolean.FALSE);
result.put("errmsg", "没有找到对应相册,压缩图片失败!");
return result;
}
List<Photo> photos = null;
if (!filesInfo.isEmpty()) {
/**
* 构造一个spot User
*/
User tempUser = new User();
tempUser.setId(ownerId);
tempUser.setNickname(spot.getName());
tempUser.setPortrait(spot.getPortrait());
photos = albumService.createPhotos(tempUser, album, filesInfo);
}
Map<Long, List<Photo>> filesMap = (Map<Long, List<Photo>>) WebHelper.getSessionAttribute(
null, Constant.SESSION_UPLOAD_OK_FILES);
if (filesMap == null) {
filesMap = new HashMap<Long, List<Photo>>();
}
filesMap.put(album.getId(), photos);
WebHelper.setSessionAttribute(null, Constant.SESSION_UPLOAD_OK_FILES, filesMap);
if (StringUtils.hasLength(message)) {// 存在错误
result.put("success", Boolean.FALSE);
result.put("errmsg", message);