Fresco: Fresco does not support resize options like picasso

Created on 2 May 2017  路  3Comments  路  Source: facebook/fresco

I was trying to use Fresco over Picasso to avoid memory leaks but found that Fresco does not support scaling as it is supported by Picasso

Following is my code to resize image using picasso
PicassoCache.getPicassoInstance(holder.itemView.getContext()) .load(Uri.encode(item.imageUrl, Constants.ALLOWED_URI_CHARS)) .tag(Constants.IMAGE_LOADING_TAGS.ALL_DEAL) .placeholder(R.drawable.imgload) .error(R.drawable.imgntfound) .resize(200, 0) .into(holder.itemImage);

Now here picasso allows either width and height to be zero and resize image accordingly. But found that Fresco does not support any functionality like this I had to specify both width and height
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri) .setResizeOptions(new ResizeOptions(200, 200)) .build(); DraweeController controller = Fresco.newDraweeControllerBuilder() .setOldController(holder.itemImage.getController()) .setImageRequest(request) .build(); holder.itemImage.setController(controller);

Is there any chance to achieve this using fresco

enhancement

Most helpful comment

is there any chance Fresco library will support functionality like these. In my app there are lots of scenarios where I don't know height or width or aspect ratio.

For now is it possible to get width and height of image then I will specify aspect ratio programmatically

All 3 comments

Unfortunately this is currently not supported @amodkanthe, you have to specify both the width and height. Similarly, Fresco also does not support wrap_content. More information on this topic can be found here: http://frescolib.org/docs/wrap-content.html

is there any chance Fresco library will support functionality like these. In my app there are lots of scenarios where I don't know height or width or aspect ratio.

For now is it possible to get width and height of image then I will specify aspect ratio programmatically

Closing as this is not a prioritized feature for the near future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goodev picture goodev  路  4Comments

bigfreeZhou picture bigfreeZhou  路  4Comments

eresid picture eresid  路  4Comments

eldk picture eldk  路  3Comments

hbzhzw picture hbzhzw  路  3Comments