Package org.shaitu.easyphoto.vo

Examples of org.shaitu.easyphoto.vo.ImageActionVO


     * @param direction -1:previous image,1:next image
     * @return image after decorative
     */
    public Image getPreviewImage(File imageFile,boolean isSmall){
        //create ImageActionVO
        ImageActionVO vo = new ImageActionVO();
        vo.setParams(this.getImageActionParamsVO());
        vo.setInputImageFile(imageFile);
        if(isSmall){
            vo.getParams().setApplyResize(true);
            int previewSize = ImageUtil.getFixedPreviewSize(imageFile,lbPreviewSmall.getHeight(),vo.getParams().isApplyExif());
            vo.getParams().setResize(previewSize);
        }
        //decorate image
        ImageAction.decorateImage(vo);
        //get swap image file
        File outputFile = new File(AppConstants.SWAP_IMAGE_BASENAME+FileUtil.getExtName(imageFile));
        outputFile.delete();
        BufferedImage previewImage = ImageUtil.storeAndRetrieveImage(vo.getBufferedImage(),outputFile,
                sdQuality.getValue()/100.0f);
        if(!isSmall){
            previewImageSize = outputFile.length();
        }
        return previewImage;
View Full Code Here


      List<File> todoImageList = new ArrayList();
            ImageUtil.findImagesRecusive(todoImageList, params.getInputFiles());
            imgCount = todoImageList.size();
      //iterator images
      for (File ifile : todoImageList) {
        ImageActionVO vo = new ImageActionVO();
        vo.setParams(params);
        File ofile = null;
        //get output file
        if (params.isOverride()) {
          //doOverride is true, just use input file as output file
          ofile = ifile;
        } else {
          //doOverride is false, save images to specified output folder
          String absPath = "";
            String outputFolderPath = vo.getParams().getOutputFolder().getAbsolutePath();
            if(outputFolderPath.endsWith("\\.")){
              outputFolderPath = outputFolderPath.substring(0, outputFolderPath.length()-2);
            }
                    absPath = outputFolderPath + File.separator + ifile.getName();
          ofile = new File(absPath);
       
        //logger.info("Input image:"+ifile.getAbsolutePath());
        //logger.info("Output image:"+ofile.getAbsolutePath());
        vo.setInputImageFile(ifile);
        vo.setOutputImageFile(ofile);
        //execute ImageDecorateTask
        threadPool.execute(new ImageDecorateTask(vo));
        Thread.sleep(10);
                //release binding resources
                System.gc();
View Full Code Here

TOP

Related Classes of org.shaitu.easyphoto.vo.ImageActionVO

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.