From 3e49c33bc119308fab162c4c1a9316f6133302d0 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Sun, 26 Apr 2026 21:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E7=9B=B8=E5=86=8C=E9=9B=86=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 裁剪封面是本地文件,直接使用Uri.fromFile加载 - 文件不存在时使用MediaStore查询 --- .../main/java/cc/winboll/studio/gallery/MainActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gallery/src/main/java/cc/winboll/studio/gallery/MainActivity.java b/gallery/src/main/java/cc/winboll/studio/gallery/MainActivity.java index 0c64e6b..3cfabaf 100644 --- a/gallery/src/main/java/cc/winboll/studio/gallery/MainActivity.java +++ b/gallery/src/main/java/cc/winboll/studio/gallery/MainActivity.java @@ -194,7 +194,12 @@ private void loadAlbums() { String coverPath = coverDbHelper.getCover(albumPath); Uri coverUri = null; if (coverPath != null) { - coverUri = getUriFromPath(coverPath); + File coverFile = new File(coverPath); + if (coverFile.exists()) { + coverUri = Uri.fromFile(coverFile); + } else { + coverUri = getUriFromPath(coverPath); + } } if (coverUri == null) { ArrayList images = getImagesInFolder(albumPath);