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

fix: DecodeForamt.RGB_565 not working #4876

Closed
wants to merge 1 commit into from
Closed

fix: DecodeForamt.RGB_565 not working #4876

wants to merge 1 commit into from

Conversation

yacyet
Copy link

@yacyet yacyet commented Aug 19, 2022

Glide.with(this)
.load(url)
.format(DecodeFormat.PREFER_RGB_565);
When set 565 format, actually this does not work. This problem has discussed in #4461.
#4461

Glide.with(this)
        .load(url)
        .format(DecodeFormat.PREFER_RGB_565);
When set 565 format, actually  this does not work. This problem has discussed in #4461. 
#4461
@google-cla
Copy link

google-cla bot commented Aug 19, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sjudd
Copy link
Collaborator

sjudd commented Aug 22, 2022

I'd rather not comment out code as a general practice.

That said, I think the issue here is fundamentally that the framework is claiming it's going to use ARGB_8888 when we ask it, even if we say we want RGB_565. We might choose to ignore outConfig entirely, but I'm not sure that's the best idea. After all there may be cases where the framework can actually only produce ARGB_8888.

I think there's two things to do:

  1. File a framework bug if we use inPreferredConfig = RGB_565, inJustDecodeBounds=true, outConfig gives us ARGB_8888, but if we provide an input Bitmap with RGB_565 the decode just works fine. Preferably we'd have a test case for this
  2. Up until whenever the framework bug in Bitmap pool is count not size limited #1 is fixed, in Glide, try to decode with RGB_565 even if outConfig gives us ARGB_8888, but being sure to retry with ARGB_8888 if our RGB_565 load fails.

The best place to start is probably tests, rather than code. There's a bunch here, maybe we could add a new one or two? https://github.com/bumptech/glide/tree/master/instrumentation

@yacyet
Copy link
Author

yacyet commented Aug 22, 2022

Got it, thanks!

@yacyet yacyet closed this Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants