telephoto: IllegalStateException: getWidth called on recycled region decoder

I have a HorizontalPager of zoomable pictures. I noticed that quite often when you swipe from first picture to the next, then back to the first picture and try to double-tap to zoom, you get this crash. It happens even in other situations when scrolling through pager and zooming. Would really appreciate some help 😃

Log:

Process: pl.bigstarltd.app.beta, PID: 30252
java.lang.IllegalStateException: getWidth called on recycled region decoder
	at android.graphics.BitmapRegionDecoder.checkRecycled(BitmapRegionDecoder.java:303)
	at android.graphics.BitmapRegionDecoder.getWidth(BitmapRegionDecoder.java:255)
	at me.saket.telephoto.subsamplingimage.internal.AndroidImageRegionDecoder.size-YEO4UFw(AndroidImageRegionDecoder.kt:80)
	at me.saket.telephoto.subsamplingimage.internal.AndroidImageRegionDecoder.decodeRegion(AndroidImageRegionDecoder.kt:50)
	at me.saket.telephoto.subsamplingimage.internal.PooledImageRegionDecoder$decodeRegion$2.invokeSuspend(PooledImageRegionDecoder.kt:25)
	at me.saket.telephoto.subsamplingimage.internal.PooledImageRegionDecoder$decodeRegion$2.invoke(Unknown Source:8)
	at me.saket.telephoto.subsamplingimage.internal.PooledImageRegionDecoder$decodeRegion$2.invoke(Unknown Source:4)
	at me.saket.telephoto.subsamplingimage.internal.ResourcePool.borrow(PooledImageRegionDecoder.kt:81)
	at me.saket.telephoto.subsamplingimage.internal.ResourcePool$borrow$1.invokeSuspend(Unknown Source:15)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
	Suppressed: java.lang.IllegalStateException: getWidth called on recycled region decoder
		... 17 more
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@d9f5671, androidx.compose.runtime.BroadcastFrameClock@5946c56, StandaloneCoroutine{Cancelling}@9b884d7, Dispatchers.IO]

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

This should be fixed with https://github.com/saket/telephoto/commit/ab1b5b51a3f7bb344f4dc3bf4db9af8f69aeccd0. I’ll make a release soon!

0.14.0 is out: https://github.com/saket/telephoto/releases/tag/0.14.0. Please let me know if you continue seeing these crashes?