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
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.
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