Пожалуйста, попробуйте следующий код. Надеюсь, это поможет.
Bitmap bMap = BitmapFactory.decodeFile (photoPath);
int orig_width = bMap.getWidth();
int orig_height = bMap.getHeight();
int aspect = orig_width / orig_height;
float aspectRatio = orig_width / orig_height;
int new_height = (int) (orig_height / (aspectRatio));
int new_width = (int) ((orig_width * aspectRatio)/2);
Bitmap scaled = Bitmap.createScaledBitmap(bMap, new_height, new_width, true);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
scaled.compress(CompressFormat.PNG, 0 /*ignored for PNG*/, bos);
byte[] bitmapdata = bos.toByteArray();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 5;
File sdImageMainDirectory = Environment.getExternalStorageDirectory();
FileOutputStream fileOutputStream = null;
String tempFile = "tempImage";
int quality = 50;
Bitmap myImage = BitmapFactory.decodeByteArray(bitmapdata, 0,bitmapdata.length);
try {
fileOutputStream = new FileOutputStream(sdImageMainDirectory.toString() +"/" + tempFile + ".jpg");
BufferedOutputStream bosBufferedOutputStream = new BufferedOutputStream(fileOutputStream);
myImage.compress(CompressFormat.JPEG, quality, bosBufferedOutputStream);
bosBufferedOutputStream.flush();
bosBufferedOutputStream.close();
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}