From 37f229cafea036c5abb749ef421c96e18d596d5b Mon Sep 17 00:00:00 2001 From: HuanYiWen <35919502@qq.com> Date: Mon, 13 Jan 2020 15:50:22 +0800 Subject: [PATCH] =?UTF-8?q?saveBitmapToDir=E6=96=B9=E6=B3=95=E5=85=BC?= =?UTF-8?q?=E5=AE=B9android10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- .../huantansheng/easyphotos/utils/bitmap/BitmapUtils.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c652611..58daa33a 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ allprojects { ```gradle dependencies { - implementation 'com.github.HuanTanSheng:EasyPhotos:3.0.3' //androidx版本,支持android 10,永久维护 + implementation 'com.github.HuanTanSheng:EasyPhotos:3.0.4' //androidx版本,支持android 10,永久维护 //implementation 'com.github.HuanTanSheng:EasyPhotos:2.4.5' //还没有升级到androidx的同学可以用这个版本,但不支持android 10,暂停维护   @@ -154,6 +154,9 @@ QQ交流群:[288600953](https://jq.qq.com/?_wv=1027&k=5QGgCDe) ## 更新日志 +**3.0.4:** +- 优化:saveBitmapToDir方法兼容andorid10 + **3.0.3:** - 修复:修复华为nova 5i pro 在相机页面点击返回时产生的崩溃问题 #87 diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/utils/bitmap/BitmapUtils.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/utils/bitmap/BitmapUtils.java index c63a956d..c1a88f46 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/utils/bitmap/BitmapUtils.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/utils/bitmap/BitmapUtils.java @@ -228,11 +228,11 @@ private static void saveBitmapToDirQ(final Activity act, final String dirPath, final boolean notifyMedia, final SaveBitmapCallBack callBack) { long dataTake = System.currentTimeMillis(); - String jpegName = namePrefix + dataTake + ".jpg"; + String jpegName = namePrefix + dataTake + ".png"; ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.DISPLAY_NAME, jpegName); - values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); + values.put(MediaStore.Images.Media.MIME_TYPE, "image/png"); int dirIndex = dirPath.lastIndexOf("/"); if (dirIndex == dirPath.length()) { String dirPath2 = dirPath.substring(0, dirIndex - 1);