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.

Transformation fail with can't create mutable bitmap with Config.HARDWARE in Picasso 3

See original GitHub issue

Using: 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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JakeWhartoncommented, Feb 26, 2019

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.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/square/picasso/issues/2066#issuecomment-467591091, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEa04tLOq-CGiHyU_3nOr-wixg49Jks5vRZKsgaJpZM4a-u81 .

0reactions
NightlyNexuscommented, Feb 26, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

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