-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception: Transformation rounded returned input Bitmap but recycled it #997
Comments
tl;dr: You returned a bitmap that was already recycled. I'm guessing that your code goes down the Remove the |
I removed that and it crashed with: which is the same as the one who wrote this comment (he is using Glide but still seems like the same issue): and he has a gif, same as me. So doesn't this transformation work with GIFs? |
If it does not then it's an Android bug. The cause of the original problem was identified (returning a recycled bitmap in your catch block) and the rest of the code looks good as far as the transformation goes. For further problems you'll have better luck elsewhere (such as StackOverflow) as it's not a problem with Picasso specifically. |
The problem is when Android performs this operation in your transform class: Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig()); If the image is a GIF, the getConfig() method returns null. Bitmap.Config config = source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888; and then change the last parameter to config, like this: Bitmap bitmap = Bitmap.createBitmap(size, size, config); The final code should be like: // For gif images
Bitmap.Config config = source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = Bitmap.createBitmap(size, size, config); Reference: comment of alxscms in this link |
A little unrelated but this discussion was the first hit in Google for my issue. Maybe it helps someone :) My app crashed with the same error, the reason was that I used
but if the dimensions of the created Bitmap where identical to source,
|
I get this error on a rounded transformation on one of our users profile picture. Any idea on how to handle this properly?
The images that causes all the issues is this one:
https://graph.facebook.com/675276189284495/picture?type=large
We have hundreds of others and none of them make the transformation crash except this FB profile image.
Here is some of the code for the transformation:
The text was updated successfully, but these errors were encountered: