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

Image wrapping with centercrop #151

Closed
okrosa opened this issue Sep 23, 2014 · 2 comments
Closed

Image wrapping with centercrop #151

okrosa opened this issue Sep 23, 2014 · 2 comments

Comments

@okrosa
Copy link

okrosa commented Sep 23, 2014

I have an interesting problem with image center crop functioning with glide. First of all I have a "square" image view which overrides the onmeasure to be square in size. If I put in a drawable, center crop functionality works fine. However If I use Glide sometimes the images gets wrapped badly. I managed to overcome the problem by changing the layout from: layout_width="wrap_content" layout_height="match_parent" to layout_width="match_parent" layout_height="match_parent". (Which is fine in my case, because the size is adjusted in the onmeasure.)

@okrosa
Copy link
Author

okrosa commented Sep 23, 2014

It is not really a bug report, just wanted to voice this issue, maybe you guys have the answer for it, or maybe it can be a potential bug. And of course it is very hard to reproduce based on my writings :). Anyway, this "square" image hack; it worked well with the Volley NetworkImages, and worked well with standard drawables, so I assume it should work well with Glide as well.

@sjudd
Copy link
Collaborator

sjudd commented Sep 24, 2014

Thanks for reporting this, Glide generally doesn't handle wrap_content well, you ran in to a particularly unusual case here where we completely ignored the dimensions of your view and used the screen dimensions instead because of wrap_content.

I'm going to dupe this into #135 where we have a larger discussion on this issue, thanks for the input, it's useful to see another case!

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