Webtoon Split: Improve performance (#7947)

This commit is contained in:
AntsyLich
2022-09-04 21:16:20 +06:00
committed by GitHub
parent 6b2b21edfa
commit d55c854ebf
4 changed files with 22 additions and 17 deletions

View File

@@ -268,8 +268,8 @@ object ImageUtil {
/**
* Split the imageStream according to the provided splitData
*/
fun splitStrip(imageStream: InputStream, splitData: SplitData): InputStream {
val bitmapRegionDecoder = getBitmapRegionDecoder(imageStream)
fun splitStrip(splitData: SplitData, streamFn: () -> InputStream): InputStream {
val bitmapRegionDecoder = getBitmapRegionDecoder(streamFn())
?: throw Exception("Failed to create new instance of BitmapRegionDecoder")
logcat {