I am trying to save bitmap as .Jpg in storage. It saved successfully with this method .
private void SaveImage(Bitmap finalBitmap) {
String root = Environment.getExternalStorageDirectory().toString();
File myDir = new File(root + "/Dir");
String fname = "Image.jpg";
File file = new File (myDir, fname);
if (file.exists ()) file.delete ();
try {
FileOutputStream out = new FileOutputStream(file);
finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
But saved Image orientation is 90 degree clockwised. I want to save it with original orientation. How can I solve this. Please kindly suggest me. Thank you.