My app ask the user to take a photo and then saves it.
I have noticed that Samsung Galaxy S2 takes a portrait photo
but when I save it to the server I see it in landscape only in the server.
(even though it was taken in portrait).
It doesn't happen for me with other phones (Samsung S4, Nexus 5).
When I look at the photo gallery I see the photo in portrait.
Update
The weird thing is that in my java code it seemed to be portrait orientation
so I really don't get it:
if (getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
//a
}else {
//b
}
But i saw something odd: the settings and other native dialog are all landscape when using S2 camera. see attachment:
Update2
I have checked exif.getAttributeInt(ExifInterface.TAG_ORIENTATION
and got 6 ( ExifInterface.ORIENTATION_ROTATE_90)
So i have tried to set this to ORIENTATION_ROTATE_270 or ORIENTATION_NORMAL
but it didn't help
ExifInterface exif;
try {
exif = new ExifInterface(imageFilename);
int orientation =
exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
exif.setAttribute(ExifInterface.TAG_ORIENTATION,
String.valueOf(ExifInterface.ORIENTATION_ROTATE_270));
exif.saveAttributes();
orientation =
exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
boolean b = orientation == Configuration.ORIENTATION_LANDSCAPE;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}