Skip to content
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

Blurring downloaded image #5

Open
ksy5662 opened this issue Dec 29, 2014 · 3 comments
Open

Blurring downloaded image #5

ksy5662 opened this issue Dec 29, 2014 · 3 comments

Comments

@ksy5662
Copy link

ksy5662 commented Dec 29, 2014

Dear PomepuyN,

Thanks for your great sample!!

I am trying to add picasso image loader to download any image from flickr.
But seems it is not working with picasso.

Picasso.with(this.getApplicationContext()).load("http://farm8.staticflickr.com/7195/6980356584_874a4e6346_z.jpg").into(mNormalImage);

Better to share any sample to blurring downloaded images.

Happy New Year!!

@chenjishi
Copy link

I tried many times to blur image downloaded from internet by use your Blur.fastblur() method, but failed. There is no any error logged, maybe renderscript problem? Later I use your method to decode a picture in local by use BitmapFactory.decodeResource(), that's will be success, rendersript worked well, but when you try blur download bitmap, that's will always be failed, I don't know why, I use Volley's ImageLoader to get bitmap from internet, when picture fetched, there will be a bitmap returned, then you use this bitmap to blur, failed with no luck.


I FIGURED OUT WHAT CAUSED THIS!!!!

Volley's ImageLoader return bitmap with Bitmap.Config.ARGB_565, but RenderScript expected Bitmap.ARGB_8888, so that's reason why your renderscript blur method crashed.

Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);

maybe you can add some error handle when passed a bitmap is Bitmap.Config.ARGB_565 💯

@devflow
Copy link

devflow commented Jun 30, 2015

You can blurring downloaded image with picasso.

Picasso.with(getContext()).load("image").transform(new Transformation() {
                    @Override
                    public Bitmap transform(Bitmap bitmap) {
                        Bitmap b = Blur.fastblur(getContext(), bitmap, 13);
                        bitmap.recycle();
                        return b;
                    }

                    @Override
                    public String key() {
                        return "blur";
                    }
                }).into(image);

NOTE: Do Not config bitmap to RGB_565

@yanxinmiao
Copy link

yanxinmiao commented Apr 27, 2016

ths ,@devflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants