KLuban icon indicating copy to clipboard operation
KLuban copied to clipboard

InputStream mark问题

Open gaowch opened this issue 2 years ago • 6 comments

Mark has been invalidated, pos: 1300464 markLimit: 5242880

gaowch avatar Sep 26 '23 03:09 gaowch

+1

xiaoyvyv avatar Nov 21 '23 07:11 xiaoyvyv

选取大图 2250x4000 9MB 时报错: Mark has been invalidated, pos: xxx markLimit: xxx

com.forjrking.lubankt.io.BufferedInputStreamWrap$InvalidMarkException: Mark has been invalidated, pos: 1701080 markLimit: 5242880
	at com.forjrking.lubankt.io.BufferedInputStreamWrap.reset(BufferedInputStreamWrap.java:318)
	at com.forjrking.lubankt.Checker$getOrientation$reader$1.getOrientation(Checker.kt:137)
	at com.forjrking.lubankt.Checker.getOrientationInternal(Checker.kt:147)
	at com.forjrking.lubankt.Checker.getOrientation(Checker.kt:141)
	at com.forjrking.lubankt.Checker.getRotateDegree(Checker.kt:167)
	at com.forjrking.lubankt.CompressEngine.compress(CompressEngine.kt:48)
	at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invokeSuspend(Luban.kt:294)
	at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invoke(Unknown Source:10)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
	at com.forjrking.lubankt.AbstractFileBuilder.compress(Luban.kt:272)
	at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invokeSuspend(Luban.kt:320)
	at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invoke(Unknown Source:10)
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)
	at com.forjrking.lubankt.CompressThreadFactory$newThread$thread$1.run(Luban.kt:403)

xiaoyvyv avatar Nov 21 '23 07:11 xiaoyvyv

选取大图 2250x4000 9MB 时报错: Mark has been invalidated, pos: xxx markLimit: xxx

com.forjrking.lubankt.io.BufferedInputStreamWrap$InvalidMarkException: Mark has been invalidated, pos: 1701080 markLimit: 5242880
	at com.forjrking.lubankt.io.BufferedInputStreamWrap.reset(BufferedInputStreamWrap.java:318)
	at com.forjrking.lubankt.Checker$getOrientation$reader$1.getOrientation(Checker.kt:137)
	at com.forjrking.lubankt.Checker.getOrientationInternal(Checker.kt:147)
	at com.forjrking.lubankt.Checker.getOrientation(Checker.kt:141)
	at com.forjrking.lubankt.Checker.getRotateDegree(Checker.kt:167)
	at com.forjrking.lubankt.CompressEngine.compress(CompressEngine.kt:48)
	at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invokeSuspend(Luban.kt:294)
	at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invoke(Unknown Source:10)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
	at com.forjrking.lubankt.AbstractFileBuilder.compress(Luban.kt:272)
	at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invokeSuspend(Luban.kt:320)
	at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invoke(Unknown Source:10)
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)
	at com.forjrking.lubankt.CompressThreadFactory$newThread$thread$1.run(Luban.kt:403)

你好可以提供下原图么?

forJrking avatar Dec 03 '23 12:12 forJrking

选取大图 2250x4000 9MB 时报错: Mark has been invalidated, pos: xxx markLimit: xxx

com.forjrking.lubankt.io.BufferedInputStreamWrap$InvalidMarkException: Mark has been invalidated, pos: 1701080 markLimit: 5242880
	at com.forjrking.lubankt.io.BufferedInputStreamWrap.reset(BufferedInputStreamWrap.java:318)
	at com.forjrking.lubankt.Checker$getOrientation$reader$1.getOrientation(Checker.kt:137)
	at com.forjrking.lubankt.Checker.getOrientationInternal(Checker.kt:147)
	at com.forjrking.lubankt.Checker.getOrientation(Checker.kt:141)
	at com.forjrking.lubankt.Checker.getRotateDegree(Checker.kt:167)
	at com.forjrking.lubankt.CompressEngine.compress(CompressEngine.kt:48)
	at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invokeSuspend(Luban.kt:294)
	at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invoke(Unknown Source:10)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
	at com.forjrking.lubankt.AbstractFileBuilder.compress(Luban.kt:272)
	at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invokeSuspend(Luban.kt:320)
	at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invoke(Unknown Source:10)
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)
	at com.forjrking.lubankt.CompressThreadFactory$newThread$thread$1.run(Luban.kt:403)

你好可以提供下原图么?

1700394551507

xiaoyvyv avatar Dec 06 '23 03:12 xiaoyvyv