From 624efcb8f95049d3c11589c25d0a7f82a66c9c9b Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 12 Apr 2022 21:52:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=AD=A3=E6=96=87=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=A7=A3=E7=A0=81=E5=A4=A7=E5=B0=8F=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/book/read/page/provider/ImageProvider.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 f9f7e3b4f..78fd90481 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 @@ -1,10 +1,6 @@ package io.legado.app.ui.book.read.page.provider import android.graphics.Bitmap -import com.bumptech.glide.load.DataSource -import com.bumptech.glide.load.engine.GlideException -import com.bumptech.glide.request.RequestListener -import com.bumptech.glide.request.target.Target import io.legado.app.R import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookSource @@ -52,12 +48,13 @@ object ImageProvider { } } return try { - ImageLoader.loadBitmap(appCtx, vFile.absolutePath).submit().get() + ImageLoader.loadBitmap(appCtx, vFile.absolutePath) + .submit(ChapterProvider.visibleWidth,ChapterProvider.visibleHeight) + .get() } catch (e: Exception) { - Coroutine.async { vFile.delete() } - //must call this method on a background thread - //ImageLoader.loadBitmap(appCtx, R.drawable.image_loading_error).submit().get() - errorBitmap + e.printStackTrace() + Coroutine.async { vFile.delete() } + errorBitmap } }