Transformation fail with can't create mutable bitmap with Config.HARDWARE in Picasso 3
See original GitHub issueUsing:
Picasso com.squareup.picasso3:picasso:3.0.0-SNAPSHOT
Pixel 2, Android 9
When trying to use a transformation, I am running into the following issue:
java.lang.RuntimeException: Transformation rounded(radius=140.0, margin=0.0) crashed with exception.
at com.squareup.picasso3.BitmapHunter$4.run(BitmapHunter.java:392)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalArgumentException: can't create mutable bitmap with Config.HARDWARE
at android.graphics.Bitmap.createBitmap(Bitmap.java:1036)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1000)
at android.graphics.Bitmap.createBitmap(Bitmap.java:950)
at android.graphics.Bitmap.createBitmap(Bitmap.java:911)
at com.nicolasmilliard.playground.ui.util.RoundedTransformation.transform(RoundedTransformation.kt:11)
at com.squareup.picasso3.BitmapHunter.applyTransformations(BitmapHunter.java:384)
at com.squareup.picasso3.BitmapHunter.hunt(BitmapHunter.java:204)
at com.squareup.picasso3.BitmapHunter.run(BitmapHunter.java:106)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Using a config or the default result in the same issue.
Sample Project https://github.com/niqo01/android-arch-playground/tree/nm/picassoBug
See Picasso usage https://github.com/niqo01/android-arch-playground/blob/nm/picassoBug/app/src/main/java/com/nicolasmilliard/playground/ui/home/ItemResultViewHolder.kt#L54 and Tranformation: https://github.com/niqo01/android-arch-playground/blob/nm/picassoBug/app/src/main/java/com/nicolasmilliard/playground/ui/util/RoundedTransformation.kt
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Immutable bitmap crash error - Stack Overflow
You have to convert your workingBitmap to Mutable Bitmap for drawing on Canvas . (Note: this method does not help save memory, it...
Read more >ImageDecoder - Android Developers
If the encoded source does not exactly match any Bitmap.Config , the next highest quality Bitmap.Config will be used avoiding any loss in...
Read more >Bitmap.CreateBitmap Method (Android.Graphics)
Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array....
Read more >We're on the engineering team for Android Jetpack ... - Reddit
For a UI written in composable functions what does the corresponding native implementation in the Android view system look like i.e. is it...
Read more >Packages - opam
Name Latest version Description
0install 2.18 Decentralised installation system
0install‑gtk 2.18 Decentralised installation system ‑ GTK UI
0install‑solver 2.18 Package dependency solver
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 Free
Top 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
Sure. Perhaps we have to expose it since, presumably, Palette will need software bitmaps.
On Tue, Feb 26, 2019 at 3:01 PM Eric Cochran notifications@github.com wrote:
we also have to warn all non-transform consumers about this behavior. i ran into a place in my codebase where i was calling Bitmap.getPixel(x, y), and that requires software bitmaps.