From 8101cf7ba8da2eb859aca2ab3f7d6ee400f87640 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 14 Apr 2022 12:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/api/controller/BookController.kt | 3 ++- .../io/legado/app/ui/book/read/page/provider/ImageProvider.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/api/controller/BookController.kt b/app/src/main/java/io/legado/app/api/controller/BookController.kt index 0abc52b35..8771c8225 100644 --- a/app/src/main/java/io/legado/app/api/controller/BookController.kt +++ b/app/src/main/java/io/legado/app/api/controller/BookController.kt @@ -88,7 +88,8 @@ object BookController { } this.bookUrl = bookUrl val bitmap = runBlocking { - ImageProvider.getImage(book, src, bookSource, width, width) + ImageProvider.cacheImage(book, src, bookSource) + ImageProvider.getImage(book, src, width, width) } return returnData.setData(bitmap) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt index 66ea0c78a..2de937b44 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt @@ -23,7 +23,7 @@ object ImageProvider { BitmapFactory.decodeResource(appCtx.resources, R.drawable.image_loading_error) } - private suspend fun cacheImage( + suspend fun cacheImage( book: Book, src: String, bookSource: BookSource?