question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chucker corrupts image resources.

See original GitHub issue

📢 Describe the bug

If OkHttp client with the ChuckerInterceptor is used for image downloads then the requests fail.

💣 To Reproduce

  1. Run the sample project. - https://github.com/MiSikora/Chucker-Bug
  2. Run the app.
  3. Select the check box to enable Chucker.
  4. Press either Coil or Picasso buttons.

🔧 Expected behavior

The image should be downloaded and displayed in the ImageView. It should work in the same way as if the ChuckerInterceptor was disabled.

📷 Screenshots

Stack trace for Picasso.

java.io.IOException: Failed to decode stream.
  at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:161)
  at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:229)
  at com.squareup.picasso.RequestCreator.get(RequestCreator.java:429)
  at io.mehow.demo.MainActivity$onCreate$3$1.invoke(MainActivity.kt:54)
  at io.mehow.demo.MainActivity$onCreate$3$1.invoke(MainActivity.kt:23)
  at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)

Stack trace for Coil.

java.lang.IllegalStateException: BitmapFactory returned a null Bitmap. Often this means BitmapFactory could not decode the image data read from the input source (e.g. network or disk) as it's not encoded as a valid image format.
  at coil.decode.BitmapFactoryDecoder.decode(BitmapFactoryDecoder.kt:156)
  at coil.RealImageLoader$loadData$2.invokeSuspend(RealImageLoader.kt:392)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:561)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:727)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:667)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:655)

📱 Smartphone

  • Device: Any Device
  • OS: Any OS
  • Lib version: 3.1.1

📄 Additional context

Issue does not exist in 3.1.0. It was introduced with 3.1.1.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MiSikoracommented, Feb 3, 2020

Cool, thanks for the quick response.

If copying is a to go solution maybe you could try to play around tee command - https://github.com/square/okio/issues/186

I don’t know if that’s helpful. I might give it a stab when I find some time.

0reactions
cortinicocommented, Feb 4, 2020

Thanks for reporting and thanks for providing also a reproducible environemtn @MiSikora.

Going to try my solution of creating copy for processing and returning original response further the chain.

Let me know if you do any progress on this side @vbuberen

I don’t know if that’s helpful. I might give it a stab when I find some time.

If you happen to have time for this, we would really appreciate your contribution 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use the System File Checker tool to repair missing or ...
Describes how to use the System File Checker tool to troubleshoot missing or corrupted system files in Windows 8.1, Windows 8, Windows 7...
Read more >
Windows Resource Protection Found Corrupt Files: 5 Fixes
1. Run a DISM Scan if SFC Can't Repair Corrupt Files ... When running an SFC scan, it will replace corrupt files with...
Read more >
[Fixed] Windows Resource Protection Found Corrupt Files but ...
While running System File Checker tool (sfc) and using sfc/scannow command to repair missing or corrupted system files, the error 'Windows ...
Read more >
[How To] Fix : Windows Resource Protection found corrupt files
Fix: Windows Resource Protection Found Corrupt FilesIn our earlier video how System File Checker and SFC Scannow is usefull and allow users ...
Read more >
What Are Corrupted Windows Files and How to Fix Them
Thankfully by using the System File Checker or the DISM (Deployment Image ... A corrupted file is simply a file that is damaged...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found