使用Thumbnails对一个文件夹下的所有图片进行压缩处理

public static void compressPic(){
        try {
            Thumbnails.of(new File("/home/y/my_temp/ydbg-xy-pic").listFiles())
                    .size(94, 100)
                    .outputFormat("jpg")
                    .toFiles(Rename.PREFIX_DOT_THUMBNAIL);
        } catch (IOException ex) {
            Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

 

posted @ 2015-06-18 17:29  yshy  阅读(1131)  评论(0编辑  收藏  举报