ビットマップを文字列 Base64 にエンコードし、mysql データベースに保存しました。次に、この情報を取得し、そこからビットマップを再構築しようとしています。
blob の値は null ではなく、base64 です。まあ、それはbase64のようです。私がこれをするとき
//This has the encoded string
String encodedString = intervention.getUser_sign()
byte[] decodedUserString = Base64.decode(intervention.getUser_sign(), Base64.NO_WRAP);
Bitmap decoded_user_sign = BitmapFactory.decodeByteArray(decodedUserString, 0, decodedUserString.length);
user_sign.setImageBitmap(decoded_user_sign);
decoded_user_sign は「null」です。
logcat では、私が持っている唯一の情報は次のとおりです。
DEBUG/skia(31358): --- SkImageDecoder::Factory returned null
これはエンコードされたコードです:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
b.compress(Bitmap.CompressFormat.PNG,50,baos);
byte[] bytes=baos.toByteArray();
String base64Image = Base64.encodeToString(bytes,Base64.NO_WRAP);
誰かが私に何が間違っているのか説明できますか?
ありがとうございました