fresco icon indicating copy to clipboard operation
fresco copied to clipboard

How to postprocess the down-sampled bitmap?

Open VAdaihiep opened this issue 10 years ago • 2 comments

I'm using fresco v 0.8.1

I want to display image from internet with blur effect.

I configured Fresco:

ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
.setDownsampleEnabled(true)
.build();
Fresco.initialize(this, config);

Load and display image:

Postprocessor postProcessor = new BasePostprocessor() {
        @Override
        public void process(Bitmap bitmap) {
            super.process(bitmap);
            blurImage(bitmap);
        }
    };
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(imageUri)
                    .setPostprocessor(postProcessor)
                    .build();

PipelineDraweeController controller 
= (PipelineDraweeController)Fresco.newDraweeControllerBuilder()
                            .setImageRequest(request)
                            .setOldController(simpleDrawee.getController())
                            .build();
simpleDrawee.setController(controller);

The problem is the bitmap I got is full resolution bitmap (about 2048x2048 png) instead of down-sampled bitmap, this make blurImage() runs too slow.

Please help me to process the down-sampled bitmap.

VAdaihiep avatar Jan 25 '16 08:01 VAdaihiep

You need to set the ResizeOptions.

plamenko avatar Jan 27 '16 15:01 plamenko

it only supports JPEG files

While image url can be png.

VAdaihiep avatar Jan 28 '16 02:01 VAdaihiep