android调用系统相机图片不旋转,Android 处理调用系统相机生成的被旋转图片
生活随笔
收集整理的這篇文章主要介紹了
android调用系统相机图片不旋转,Android 处理调用系统相机生成的被旋转图片
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
主要通過獲取EXIF信息進(jìn)行設(shè)置:
public?static?int?readPictureDegree(String?path)?{
int?degree??=?0;
try?{
ExifInterface?exifInterface?=?new?ExifInterface(path);
int?orientation?=?exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,?ExifInterface.ORIENTATION_NORMAL);
switch?(orientation)?{
case?ExifInterface.ORIENTATION_ROTATE_90:
degree?=?90;
break;
case?ExifInterface.ORIENTATION_ROTATE_180:
degree?=?180;
break;
case?ExifInterface.ORIENTATION_ROTATE_270:
degree?=?270;
break;
}
}?catch?(IOException?e)?{
e.printStackTrace();
}
return?degree;
}
總結(jié)
以上是生活随笔為你收集整理的android调用系统相机图片不旋转,Android 处理调用系统相机生成的被旋转图片的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CentOS7.0安装Nginx 1.7
- 下一篇: android n模拟器,BlueSta