Package net.imagine.provider.skyline

Examples of net.imagine.provider.skyline.ImageResizeResult


  private List<ImageResizeResult> processResizeResult(
      List<ImageResizeResult> results, StringBuilder message) {
    List<ImageResizeResult> filesInfo = new ArrayList<ImageResizeResult>();
    for (int i = 0; i < results.size(); i++) {
      ImageResizeResult result = results.get(i);
      ResultState state = result.getResultState();
      switch (state) {
      case SUCCESS:
        filesInfo.add(result);
        break;
      case NOT_IMAGE:
        message.append("上传图片" + result.getOriginalFilename()
            + "失败,失败原因:图片格式不支持。<br/>");
        break;
      default:
        message.append("上传图片" + result.getOriginalFilename()
            + "失败。<br/>");
        break;
      }
    }
    return filesInfo;
View Full Code Here


      MultipartImageResizeTask resizeTask = new MultipartImageResizeTask(file, baseSizes,
          null, false);
      resizeTask.setAlbumId(albumId);
      resizeTask.setUserId(userId);
      resizeTask.setSupportMulitFrame(false);
      ImageResizeResult processResult = imagine.processSingleImage(basePath, resizeTask);
      ResultState resultState = processResult.getResultState();
      if (resultState != ResultState.SUCCESS) {
        jsonMap = resultToJsonMap(resultState, null);
        OutputStream out = response.getOutputStream();
        outputJsonResult(out, jsonMap);
        return;
View Full Code Here

      MultipartImageResizeTask resizeTask = new MultipartImageResizeTask(file, baseSizes,
          null, false);
      resizeTask.setAlbumId(albumId);
      resizeTask.setUserId(spotId);
      resizeTask.setSupportMulitFrame(false);
      ImageResizeResult processResult = imagine.processSingleImage(basePath, resizeTask);
      ResultState resultState = processResult.getResultState();
      if (resultState != ResultState.SUCCESS) {
        jsonMap = resultToJsonMap(resultState, null);
        OutputStream out = response.getOutputStream();
        outputJsonResult(out, jsonMap);
        return;
View Full Code Here

        albumId, albumName, authority, activity, fileKeys, middleFileKeys, smallFileKeys,
        fileExts, fileSizes);
    albumDao.updatePhotoCount(userId, albumId, ids.size());
    List<Photo> photos = new ArrayList<Photo>(size);
    for (int i = 0; i < size; i++) {
      ImageResizeResult result = filesInfo.get(i);
      String[] keys = result.getFileKeys();
      if(ids.get(i) == null) {//返回为空,表示插入失败
        continue;
      }
      Photo photo = new Photo();
      photo.setId(ids.get(i));
      photo.setOwnerId(userId);
      photo.setOwnerNickname(userNickname);
      photo.setOwnerPortrait(userPortrait);
      photo.setAlbumId(albumId);
      photo.setAlbumName(albumName);
      photo.setAuthority(authority);
      photo.setActivity(activity);
      photo.setFile(keys[0]);
      photo.setMiddleFile(keys[1]);
      photo.setSmallFile(keys[2]);
      photo.setExt(result.getExt());
      photo.setSize(result.getFileSize());
      photos.add(photo);
    }
    return photos;
  }
View Full Code Here

  private List<ImageResizeResult> processResizeResult(List<ImageResizeResult> results,
      StringBuilder message) {
    List<ImageResizeResult> filesInfo = new ArrayList<ImageResizeResult>();
    for (int i = 0; i < results.size(); i++) {
      ImageResizeResult result = results.get(i);
      ResultState state = result.getResultState();
      switch (state) {
      case SUCCESS:
        filesInfo.add(result);
        break;
      case NOT_IMAGE:
        message.append("上传图片" + result.getOriginalFilename() + "失败,失败原因:图片格式不支持。<br/>");
        break;
      default:
        message.append("上传图片" + result.getOriginalFilename() + "失败。<br/>");
        break;
      }
    }
    return filesInfo;
  }
View Full Code Here

        // 压缩该目标图片
        LocalImageResizeTask task = new LocalImageResizeTask(localFile, baseSizes);
        task.setAlbumId(albumId);
        task.setUserId(ownerId);
        task.setSupportMulitFrame(false);
        ImageResizeResult resizeResult = imagine.processSingleImage(localStorePath, task);
        Photo portrait = albumService
            .createPortraitPhoto(user, portraitAlbum, resizeResult);
        remoteFileKey = portrait.getSmallFile() + '.' + portrait.getExt();
      } else {
        albumService.copyPhotoToPortraitAlbum(portraitAlbum, photo);
View Full Code Here

TOP

Related Classes of net.imagine.provider.skyline.ImageResizeResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.