mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 04:37:25 +01:00
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.
This commit is contained in:
parent
154f4d327c
commit
d0e64d3a66
@ -551,7 +551,7 @@ object ImageUtil {
|
|||||||
imageStream: InputStream,
|
imageStream: InputStream,
|
||||||
resetAfterExtraction: Boolean = true,
|
resetAfterExtraction: Boolean = true,
|
||||||
): BitmapFactory.Options {
|
): BitmapFactory.Options {
|
||||||
imageStream.mark(imageStream.available() + 1)
|
imageStream.mark(Int.MAX_VALUE)
|
||||||
|
|
||||||
val imageBytes = imageStream.readBytes()
|
val imageBytes = imageStream.readBytes()
|
||||||
val options = BitmapFactory.Options().apply { inJustDecodeBounds = true }
|
val options = BitmapFactory.Options().apply { inJustDecodeBounds = true }
|
||||||
|
Loading…
Reference in New Issue
Block a user