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