浏览代码

为压缩后文件命名添加后缀

郑梓斌 7 年之前
父节点
当前提交
7c204a986e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      library/src/main/java/top/zibin/luban/Luban.java

+ 1 - 1
library/src/main/java/top/zibin/luban/Luban.java

@@ -43,7 +43,7 @@ public class Luban implements Handler.Callback {
    */
   private File getImageCacheFile(Context context) {
     if (getImageCacheDir(context) != null) {
-      return new File(getImageCacheDir(context) + "/" + System.currentTimeMillis() + (int) (Math.random() * 100));
+      return new File(getImageCacheDir(context) + "/" + System.currentTimeMillis() + (int) (Math.random() * 1000) + ".jpg");
     }
     return null;
   }