Android : How to convert the compressed images to string with minimum size

≯℡__Kan透↙ 提交于 2019-12-02 12:35:32

There's one big difference in your images though.

The image you store as a file is stored as a JPEG

bitmapImg.compress(Bitmap.CompressFormat.JPEG, 80, out);

while the Base64 encoded string is a PNG

bitmapImg.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOS);

This can explain the size differences. Another thing could be, that bitmapImg changed it's contents inbetween both compressions as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!