I try do this:
Bitmap bitmapOrg = BitmapFactory.decodeFile("/sdcard/"+ photoName + ".jpg");
int width = bitmapOrg.getWidth();
int height = bitmapOrg.getHeight();
Matrix matrix = new Matrix();
matrix.postRotate(90);
Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0, width,
height, matrix, true);
FileOutputStream os;
try {
os = new FileOutputStream(String.format(
"/sdcard/" + photoName + "-rotate.jpg",
System.currentTimeMillis()));
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 100, os);
rotated file size > original file size, because rotated file resolution = 96 dpi, but original file = 72 dpi. Why is this happening and how to fix it?
You could add in the following line right before
FileOutputStream os;: