Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传部分图片时会抛出异常:InvalidMarkException: Mark has been invalidated, pos: 1423393 markLimit: 5242880 #21

Open
FourteenWey opened this issue Sep 28, 2021 · 2 comments

Comments

@FourteenWey
Copy link

并不是所有图片都会抛异常,只有小部分图片会,但不知道是什么原因,希望可以排查一下
W/System.err: com.forjrking.lubankt.io.BufferedInputStreamWrap$InvalidMarkException: Mark has been invalidated, pos: 1423393 markLimit: 5242880
W/System.err: at com.forjrking.lubankt.io.BufferedInputStreamWrap.reset(BufferedInputStreamWrap.java:318)
W/System.err: at com.forjrking.lubankt.Checker$getOrientation$reader$1.getOrientation(Checker.kt:137)
W/System.err: at com.forjrking.lubankt.Checker.getOrientationInternal(Checker.kt:147)
W/System.err: at com.forjrking.lubankt.Checker.getOrientation(Checker.kt:141)
W/System.err: at com.forjrking.lubankt.Checker.getRotateDegree(Checker.kt:167)
W/System.err: at com.forjrking.lubankt.CompressEngine.compress(CompressEngine.kt:48)
W/System.err: at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invokeSuspend(Luban.kt:294)
W/System.err: at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invoke(Unknown Source:10)
W/System.err: at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
W/System.err: at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
W/System.err: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
W/System.err: at com.forjrking.lubankt.AbstractFileBuilder.compress(Luban.kt:272)
W/System.err: at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invokeSuspend(Luban.kt:320)
W/System.err: at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invoke(Unknown Source:10)
W/System.err: at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
W/System.err: at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:212)
W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:207)
W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:169)
W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
W/System.err: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:923)

图片地址:
谷歌网盘

@forJrking
Copy link
Owner

并不是所有图片都会抛异常,只有小部分图片会,但不知道是什么原因,希望可以排查一下 W/System.err: com.forjrking.lubankt.io.BufferedInputStreamWrap$InvalidMarkException: Mark has been invalidated, pos: 1423393 markLimit: 5242880 W/System.err: at com.forjrking.lubankt.io.BufferedInputStreamWrap.reset(BufferedInputStreamWrap.java:318) W/System.err: at com.forjrking.lubankt.Checker$getOrientation$reader$1.getOrientation(Checker.kt:137) W/System.err: at com.forjrking.lubankt.Checker.getOrientationInternal(Checker.kt:147) W/System.err: at com.forjrking.lubankt.Checker.getOrientation(Checker.kt:141) W/System.err: at com.forjrking.lubankt.Checker.getRotateDegree(Checker.kt:167) W/System.err: at com.forjrking.lubankt.CompressEngine.compress(CompressEngine.kt:48) W/System.err: at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invokeSuspend(Luban.kt:294) W/System.err: at com.forjrking.lubankt.AbstractFileBuilder$compress$2.invoke(Unknown Source:10) W/System.err: at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91) W/System.err: at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165) W/System.err: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1) W/System.err: at com.forjrking.lubankt.AbstractFileBuilder.compress(Luban.kt:272) W/System.err: at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invokeSuspend(Luban.kt:320) W/System.err: at com.forjrking.lubankt.SingleRequestBuild$asyncRun$1$1.invoke(Unknown Source:10) W/System.err: at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61) W/System.err: at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:212) W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:207) W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:169) W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0) W/System.err: at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60) W/System.err: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) W/System.err: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/System.err: at java.lang.Thread.run(Thread.java:923)

图片地址: 谷歌网盘

试试最新版本

@IdioticMadman
Copy link

我这里也还是有这种情况。我觉得这个bufferedInputStream只是 适用于当前自己写的代码对这个inputStream进行读写的时候。如果是把inputStream包装以后扔给某些其他的库进行使用。很难保证说不超出martLimit。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants