Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresco does not support resize options like picasso #1745

Closed
amodkanthe opened this issue May 2, 2017 · 3 comments
Closed

Fresco does not support resize options like picasso #1745

amodkanthe opened this issue May 2, 2017 · 3 comments

Comments

@amodkanthe
Copy link

amodkanthe commented May 2, 2017

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

@oprisnik
Copy link
Contributor

oprisnik commented May 4, 2017

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

@amodkanthe
Copy link
Author

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

@erikandre
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants