안드로이드펍 가족님들.
http://stackoverflow.com/questions/19511610/camera-intent-auto-rotate-to-90-degree
여기 보고 하는데
lg폰으로 카메라 찍을시 이미지가 회전해서 위에 블로그 처럼 처리를 했는데 로그를 찍어보니 회전값이 계속0이라고 합니다
g2폰입니다 카메라 이미지 상세보기하면 90%라고 되어있거든요 ㅜㅜ
멀 잘못한걸까요
Matrix matrix = new Matrix();
matrix.postRotate(getImageOrientation(imageUri.getPath()));
mSelectedBitmap = Bitmap.createBitmap(mSelectedBitmap, 0, 0, mSelectedBitmap.getWidth(),
mSelectedBitmap.getHeight(), matrix, true);
public static int getImageOrientation(String imagePath){
int rotate = 0;
try {
File imageFile = new File(imagePath);
ExifInterface exif = new ExifInterface(
imageFile.getAbsolutePath());
int orientation = exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_270:
rotate = 270;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
rotate = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_90:
rotate = 90;
break;
}
} catch (IOException e) {
e.printStackTrace();
}
return rotate;
}
회전값을 제대로 알ㅇ오지못하고 있스빈다