Java源码示例:top.zibin.luban.CompressionPredicate

示例1
public static void compressImg(String sourcePath, String targetPath,
    OnCompressListener compressListener) {
    Luban.with(TokApplication.getInstance())
        .load(sourcePath)
        .ignoreBy(IMG_LIMIT_SIZE)
        .setTargetDir(targetPath)
        .filter(new CompressionPredicate() {
            @Override
            public boolean apply(String path) {
                return isCompressImg(path);
            }
        })
        .setCompressListener(compressListener)
        .launch();
}