I try to compress a 2M png image using Bitmap.compress(...)
method。
Bitmap bitmap = decodeFroeSomeFile(); //It's a 2M png image.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
File result = generateFileFromStream(baos); //It's a file larger then 2M
Because of I use a compression quality of 100, I think the file of the result file should equal to the origin file. But the result file is larger than the origin file. I can not figure it out according the API documents.