Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android bitmap.getConfig() = null

Bitmap bmp = BitmapFactory.decodeStream(inputStream, null, op);
bmp.getConfig() = null;

why bmp.getConfig() = null;

anybody who knows, please help me!

like image 265
user2571583 Avatar asked May 15 '26 07:05

user2571583


1 Answers

It looks like Bitmaps decoded from GIFs don't have a config. From AOSP's Bitmap source code,

public static Bitmap createBitmap(Bitmap source, int x, int y, int width, int height, Matrix m, boolean filter) {

   final Config config = source.getConfig();
        // GIF files generate null configs, assume ARGB_8888
        if (config != null) {
            ...
        }

}
like image 80
Vairavan Avatar answered May 16 '26 20:05

Vairavan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!