From d0e64d3a66d227ca61fc8d956b03cab5ac3b84f0 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sat, 9 Mar 2024 23:09:06 +0800 Subject: [PATCH] Fix dual page split for local source (#485) `InputStream.available()` is implementation-dependent, should never assume it will return the total number of bytes in the stream. --- .../main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/common/src/main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt b/core/common/src/main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt index 1c13d2be7..b01f4e882 100644 --- a/core/common/src/main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt +++ b/core/common/src/main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt @@ -551,7 +551,7 @@ object ImageUtil { imageStream: InputStream, resetAfterExtraction: Boolean = true, ): BitmapFactory.Options { - imageStream.mark(imageStream.available() + 1) + imageStream.mark(Int.MAX_VALUE) val imageBytes = imageStream.readBytes() val options = BitmapFactory.Options().apply { inJustDecodeBounds = true }