I have app that take picture. My problem is orientation of image that save on device . I solve preview orientation use many method but it isn't affect on image that save on device. method that I use to fix problem :
Camera.Parameters parameters = camera.getParameters();
parameters.set("orientation", "portrait");
camera.setParameters(parameters);
&
mCamera.setDisplayOrientation(90);
&
mCamera.setDisplayOrientation(90);
mParameters = mCamera.getParameters();
mParameters.setRotation(90);
mCamera.setParameters(mParameters);
& in AndroidMainfest.xml
android:screenOrientation="portrait"
and also method that describe in official site for android developer and it say : " If you want to make the camera image show in the same orientation as the display, you can use the following code " in this address: here
all of this method work fine for camera preview orientation but not on saved image. also I don't want to use this :
String path = pictureFile.getPath().toString();
Bitmap bmp = BitmapFactory.decodeFile(path);
Matrix matrix = new Matrix();
matrix.postRotate(90);
bmp = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
because this method use saved image and rotate it and save it again and reduce quality of image. any idea except this methods ? thank's