I'm trying to compress a bitmap with JPG compression function.
This is my piece of code:
ByteArrayOutputStream out = new ByteArrayOutputStream();
originalBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
byte[] newArray = out.toByteArray();
Bitmap compressed = BitmapFactory.decodeByteArray(newArray, 0, newArray.length);
The strange behavior is that if I change the compression factor (ie. from 80 to 50) the size of the "out" array will change.... but the bitmap "compressed" remain always with the same byte number as the "originalBitmap".
Someone can explain to me why?!?
Thanks in advance...