From 116b843ee8d62fac307fa5e0a63c4b0319285f74 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 14 Apr 2022 18:42:05 +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 --- app/src/main/assets/updateLog.md | 1 + .../main/java/io/legado/app/help/http/cronet/CronetHelper.kt | 2 -- .../io/legado/app/ui/book/read/page/provider/ImageProvider.kt | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 9db901086..a714b9b05 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -16,6 +16,7 @@ * 修复解码正文图片报错,添加解码日志 * js文档:java.toast java.longToast * cookie保存策略更改,若登录失效请重新登录 +* cronet和okHttp共用线程池 **2022/04/12** diff --git a/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt b/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt index 954d2f62f..55e1d8498 100644 --- a/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt @@ -15,8 +15,6 @@ import org.chromium.net.UrlRequest import splitties.init.appCtx -//val executor: ExecutorService by lazy { Executors.newCachedThreadPool() } - val cronetEngine: ExperimentalCronetEngine? by lazy { if (!AppConfig.isGooglePlay) { CronetLoader.preDownload() 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 147d33e41..b6720cb2a 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 @@ -55,6 +55,9 @@ object ImageProvider { // inJustDecodeBounds如果设置为true,仅仅返回图片实际的宽和高,宽和高是赋值给opts.outWidth,opts.outHeight; op.inJustDecodeBounds = true BitmapFactory.decodeFile(file.absolutePath, op) + if (op.outWidth == 0 && op.outHeight == 0) { + return Size(errorBitmap.width, errorBitmap.height) + } return Size(op.outWidth, op.outHeight) }