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.

(cherry picked from commit d0e64d3a66d227ca61fc8d956b03cab5ac3b84f0)

# Conflicts:
#	core/common/src/main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt
This commit is contained in:
FooIbar 2024-03-09 23:09:06 +08:00 committed by Cuong M. Tran
parent df864011e3
commit 748902e105
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -652,7 +652,7 @@ object ImageUtil {
if (zip4jFile != null && zip4jEntry != null) return extractImageOptionsZip4j(zip4jFile, zip4jEntry)
// SY <--
imageStream.mark(imageStream.available() + 1)
imageStream.mark(Int.MAX_VALUE)
val imageBytes = imageStream.readBytes()
val options = BitmapFactory.Options().apply { inJustDecodeBounds = true }