Fresco SimpleDraweeView加载本地图片不支持ResizeOptions?

时间:2016-11-11 04:50:31

标签: image local fresco

ImageRequest request = ImageRequestBuilder.newBuilderWithSource(pictureInfo.getPictureUri())
                    .setResizeOptions(new ResizeOptions(100, 100))
                    .build();
            DraweeController controller = Fresco.newDraweeControllerBuilder()
                    .setOldController(pictureView.getController())
                    .setImageRequest(request)
                    .setControllerListener(new BaseControllerListener<ImageInfo>() {
                        @Override
                        public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                            super.onFinalImageSet(id, imageInfo, animatable);
                            System.out.println("onFinalImageSet = " + imageInfo.getWidth() + " " + imageInfo.getHeight());
                        }
                    })
                    .build();
            pictureView.setController(controller);

当我使用代码加载本地图片时,imageInfo的宽度和高度始终是原始大小。

壁画有三种类型可以调整大小:缩放,调整大小和下采样。<​​/ p>

如果我将调整大小类型设置为下采样,则图片调整大小效果很好:

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

但是当我注释时,图片调整工作失败,然后导致OutOfMemory错误?

这是我的错吗?或者它是一个Bug?

compile 'com.facebook.fresco:fresco:0.14.1'

0 个答案:

没有答案