mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Fix tall image split math issues
- Round up per-split height to ensure the entire page ends up being split - Handle the last split of a page potentially being shorter than the others
This commit is contained in:
@@ -18,6 +18,7 @@ import androidx.core.graphics.green
|
||||
import androidx.core.graphics.red
|
||||
import tachiyomi.decoder.Format
|
||||
import tachiyomi.decoder.ImageDecoder
|
||||
import java.io.BufferedInputStream
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.InputStream
|
||||
@@ -103,7 +104,7 @@ object ImageUtil {
|
||||
*
|
||||
* @return true if the width is greater than the height
|
||||
*/
|
||||
fun isWideImage(imageStream: InputStream): Boolean {
|
||||
fun isWideImage(imageStream: BufferedInputStream): Boolean {
|
||||
val options = extractImageOptions(imageStream)
|
||||
imageStream.reset()
|
||||
return options.outWidth > options.outHeight
|
||||
|
||||
Reference in New Issue
Block a user