Package com.baasbox.service.storage.StorageUtils

Examples of com.baasbox.service.storage.StorageUtils.ImageDimensions


      }
      return getResizedPicture (id,sizePattern);
    }
   
    public static byte[] getResizedPicture(String id, String sizePattern) throws InvalidSizePatternException, SqlInjectionException, DocumentIsNotAnImageException, DocumentIsNotAFileException, DocumentNotFoundException, IOException, FileTooBigException {
      ImageDimensions dimensions = StorageUtils.convertPatternToDimensions(sizePattern);
      return getResizedPicture (id,dimensions);
    }
View Full Code Here


          String[] fileName=((String)doc.field("fileName")).split("\\.");
          filename=fileName[0] + "_" + sizeId + "." + (fileName.length>1?fileName[1]:"");
        }else if (!resizeIsEmpty){
          if (!ImagesConfiguration.IMAGE_ALLOWED_AUTOMATIC_RESIZE_FORMATS.getValueAsString().contains(resize) && !UserService.userCanByPassRestrictedAccess(DbHelper.currentUsername()))
            throw new InvalidSizePatternException("The requested resize format is not allowed");
          ImageDimensions imgDim = StorageUtils.convertPatternToDimensions(resize);
          output = FileService.getResizedPicture(id, imgDim);
          String[] fileName=((String)doc.field("fileName")).split("\\.");
          filename=fileName[0] + "_" + resize + "." + (fileName.length>1?fileName[1]:"");
        }else{
          ORecordBytes record = doc.field(FileService.BINARY_FIELD_NAME);
View Full Code Here

  }
 
  public static byte[] getResizedPicture (String fileAssetName, String sizePattern) throws SqlInjectionException, IOException, InvalidSizePatternException, DocumentIsNotAnImageException, DocumentIsNotAFileException{
    if (!ImagesConfiguration.IMAGE_ALLOWED_AUTOMATIC_RESIZE_FORMATS.getValueAsString().contains(sizePattern))
      throw new InvalidSizePatternException("The requested resize format is not allowed");
    ImageDimensions dimensions = StorageUtils.convertPatternToDimensions(sizePattern);
    return getResizedPicture (fileAssetName,dimensions);
  }
View Full Code Here

TOP

Related Classes of com.baasbox.service.storage.StorageUtils.ImageDimensions

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.