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

Crash when opening portrait photos in landscape #49

Closed
Level6LaserLotus opened this issue Sep 21, 2023 · 4 comments
Closed

Crash when opening portrait photos in landscape #49

Level6LaserLotus opened this issue Sep 21, 2023 · 4 comments

Comments

@Level6LaserLotus
Copy link

After updating from 0.5.0 to 0.6.1 I get crashes when opening portrait photos in landscape. Im using the following code (works with 0.5.0):

ZoomableAsyncImage(
    model = photoUrl,
    contentDescription = null,
    modifier = Modifier
        .fillMaxSize()
        .background(Color.Black)
)

The crash:

java.lang.IllegalArgumentException: Cannot coerce value to an empty range: maximum 1080 is less than minimum 1102.
at kotlin.ranges.RangesKt___RangesKt.coerceIn(_Ranges.kt:1413)
at me.saket.telephoto.subsamplingimage.internal.DimensKt.coerceIn-dFh3_74(dimens.kt:16)
at me.saket.telephoto.subsamplingimage.internal.TileGridGeneratorKt.generate-JPKKBEo(tileGridGenerator.kt:32)
at me.saket.telephoto.subsamplingimage.SubSamplingImageStateKt$rememberSubSamplingImageState$5$1$invokeSuspend$$inlined$flatMapLatest$1.invokeSuspend(Merge.kt:216)
at me.saket.telephoto.subsamplingimage.SubSamplingImageStateKt$rememberSubSamplingImageState$5$1$invokeSuspend$$inlined$flatMapLatest$1.invoke(Unknown Source:21)
at me.saket.telephoto.subsamplingimage.SubSamplingImageStateKt$rememberSubSamplingImageState$5$1$invokeSuspend$$inlined$flatMapLatest$1.invoke(Unknown Source:4)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invokeSuspend(Merge.kt:34)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(Unknown Source:8)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:44)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:112)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1.emit(Merge.kt:33)
at me.saket.telephoto.subsamplingimage.SubSamplingImageStateKt$rememberSubSamplingImageState$5$1$invokeSuspend$$inlined$filter$1$2.emit(Emitters.kt:223)
at kotlinx.coroutines.flow.FlowKt__TransformKt$filterNotNull$$inlined$unsafeTransform$1$2.emit(Emitters.kt:223)
at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.invoke(SafeCollector.kt:15)
at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.invoke(SafeCollector.kt:15)
at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:87)
at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:66)
at androidx.compose.runtime.SnapshotStateKt__SnapshotFlowKt$snapshotFlow$1.invokeSuspend(SnapshotFlow.kt:133)
at androidx.compose.runtime.SnapshotStateKt__SnapshotFlowKt$snapshotFlow$1.invoke(Unknown Source:8)
at androidx.compose.runtime.SnapshotStateKt__SnapshotFlowKt$snapshotFlow$1.invoke(Unknown Source:4)
at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
at kotlinx.coroutines.flow.FlowKt__TransformKt$filterNotNull$$inlined$unsafeTransform$1.collect(SafeCollector.common.kt:114)
at me.saket.telephoto.subsamplingimage.SubSamplingImageStateKt$rememberSubSamplingImageState$5$1$invokeSuspend$$inlined$filter$1.collect(SafeCollector.common.kt:113)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invokeSuspend(Merge.kt:27)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(Unknown Source:8)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest.flowCollect(Merge.kt:25)
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 kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@8f2a5b1, androidx.compose.runtime.BroadcastFrameClock@5b2aa96, StandaloneCoroutine{Cancelling}@3108617, AndroidUiDispatcher@3ae4a04]
```
@saket saket closed this as completed in b8383b3 Sep 22, 2023
@saket
Copy link
Owner

saket commented Sep 22, 2023

Thanks for reporting @Level6LaserLotus! You can unblock yourself by using 0.7.0-SNAPSHOT when this build finishes running. I'll also make a new release tomorrow.

@saket
Copy link
Owner

saket commented Sep 22, 2023

Actually, can you double check that this fixes the crash for your image/device before I publish the release?

@Level6LaserLotus
Copy link
Author

The crash no longer happens with the 0.7.0-SNAPSHOT version. Thanks for fixing it so quickly. 👍

@saket
Copy link
Owner

saket commented Sep 23, 2023

Awesome! 0.6.2 is now available on maven central.

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

2 participants