SadClown
SadClown

Reputation: 658

RenderScript blur breaks bitmap loaded by Glide

So, the thing is that I am fetching some images using Glide. I fetch them directly into bitmap, and then I blur that bitmap using RenderScript and than show on UI blurred one.

UI itself has "All Images" activity and "Single Image" activity. User clicks on the image on the first activity, and the blurred version is showed on the second one, so it is possible to go back and forth opening and closing the same image.

The issue is that this cause image to become broken, and there is no way to fix it unless you clear all app data.

The issue even survives app reinstall (using Android Studio). So, if I open image, and it is displayed as it should, than make some changes in code, and install the app again, image would show broken immediately after installation, unless I clear data.

It happens only with bitmaps loaded using glide. If I get some drawable resource as bitmap, everything works well.

UPDATE: This is the code used here;

Bitmap logo = Glide.with(context)
                        .load(url)
                        .asBitmap()
                        .into(80, 80)
                        .get();
return BlurBuilder.blur(context, logo);

And BlurBuilder is the class copied from here: Create blurry transparent background effect

Broken image

Upvotes: 0

Views: 688

Answers (1)

Dennis Volkmer
Dennis Volkmer

Reputation: 56

Had the same problem. Solved it by setting the Glide decode format to ARGB_8888 https://github.com/bumptech/glide/wiki/Configuration#bitmap-format

Upvotes: 2

Related Questions