I have a JPEG file of 2550x3300 size (this file was created with quality level 90). The physical size of the file is 2.5 MB. I would like to scale down this image to 1288x1864 (50% of the original dimension) and save with same quality 90. But I want to know the physical size of the down sampled image in advance, even before doing the actual scale down.
Any help is appreciated!
Here is the code I am using,
`
//Decodes the existing file to bitmap
Bitmap srcBP = BitmapFactory.decodeFile(filePath, options);
//Calculates required width and height
int reqWidth = options.outWidth * .50;
int reqHeight = options.outHeight * .50;
//Creates scaled image
Bitmap outBP = Bitmap.createScaledBitmap(srcBP, reqWidth, reqHeight, false);
//Save modified as JPEG
File tempFile = new File(imageOutPath);
FileOutputStream out = new FileOutputStream(tempFile);
outBP.compress(Bitmap.CompressFormat.JPEG, compression, out);
out.close();
`