0

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

Community
  • 1
  • 1
SadClown
  • 648
  • 8
  • 16
  • several questions: 1. Are you using Instant-Run feature on Android Studio? 2. Could you post the code snippets blurring the image, I mean how did your code handle the blurred image. – Miao Wang Sep 29 '16 at 17:43
  • I've updated my question, there you can find the answer on question 2. And as for question 1 - no, not using instant run. – SadClown Sep 30 '16 at 10:33

1 Answers1

2

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

  • Already made it work by tweaking caching options, but if this makes it work without changing cache, that'd be great. Will check sometime these days, and come back with results. – SadClown Oct 06 '16 at 12:23