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
- Run the sample project. - https://github.com/MiSikora/Chucker-Bug
- Run the app.
- Select the check box to enable Chucker.
- Press either
Coil
orPicasso
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:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Thanks for reporting and thanks for providing also a reproducible environemtn @MiSikora.
Let me know if you do any progress on this side @vbuberen
If you happen to have time for this, we would really appreciate your contribution 😃