Blob For bitmap returns null only on Android 4.2.2

Asked

Viewed 48 times

0

It’s simple, if I use this line of code on android 5.0 , 6.0 it works correctly, and converts the blob into bitmap. However, testing here on a lower device (android 4.2.2 ) it always returns null;

private Bitmap blotToBit(Blob blob) {
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inSampleSize = 4;
    return BitmapFactory.decodeStream(blob.getBinaryStream(), null, options);
}

A simple log line is displayed for each attempt :

D/skia: --- SkImageDecoder::Factory returned null

Note, that bitmaps are 256x256 will already be very large ?

Obs . I have tried using only 1 blob , and still , does not convert

  • Rodrigo, did you check if the bank is not returning a null Blob? As a suggestion use another approach and store in String Base64 and convert it to Bitmap. This has a number of advantages. Including for example, encrypt the image to store in the bank, stream over the network etc.

  • Yes I have checked, I am using the same bank in all Sos. And the blob is not null !

  • Opa, Rodrigo, I believe that if instead of using the "Blob" typeVoce took the image as an Hex string and converted it to an image using bytearray Voce would be more successful in this. here’s a good example [http://stackoverflow.com/questions/10143135/hex-string-to-image]

  • convert or convert? am pessimo in Portuguese, ririri

  • the worst part is it works on other systems , but there is no Warming any api

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.