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

BitmapFactory.Options.inPreferQualityOverSpeed #1048

Closed
BattleShipPark opened this issue Mar 10, 2016 · 3 comments
Closed

BitmapFactory.Options.inPreferQualityOverSpeed #1048

BattleShipPark opened this issue Mar 10, 2016 · 3 comments

Comments

@BattleShipPark
Copy link

Hi,
I'd like to access to Options.inPreferQualityOverSpeed to obtain higher quality image from bitmap.
I think it is in Downsampler.java, but I can't change options because it is private field.
How can I access and change it?
Thanks.

@TWiStErRob
Copy link
Collaborator

You can use a custom Downsampler:

Glide
        .with(context)
        .load(...)
        .asBitmap()
        .imageDecoder(new StreamBitmapDecoder(new Downsampler() {
            ...
        }, Glide.get(context).getBitmapPool(), DecodeFormat.PREFER_ARGB_8888))
        .into(imageView);

the problem is that all the downsampler methods are private so you can't just change a little bit of it.

I think @sjudd may accept a well-thought-out refactor PR of Downsampler that exposes some of it's private API as protected. It has came up before somewhere.

@sjudd
Copy link
Collaborator

sjudd commented May 17, 2016

This would also be easy to expose as an Option in v4. If anyone is interested in implementing this I'd be happy to provide more direction.

@sjudd sjudd removed their assignment May 17, 2016
@sjudd
Copy link
Collaborator

sjudd commented Oct 7, 2017

This field is now deprecated and ignored on newer versions of Android, so I'm going to close this for now: https://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inPreferQualityOverSpeed

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