【发布时间】:2012-05-21 13:34:36
【问题描述】:
我在 imageview 中显示图像,该图像是由 android 相机的 Intent 方法捕获的。我已经在三星 Nexus 上测试过这段代码,但是当我在 Nexus S 上测试时,图像会自行旋转 270 度。我已经浏览了这些链接
ACTION_IMAGE_CAPTURE orientation problem on Nexus S and Samsung Galaxy S I9000
Camera/picture orientation in Android
http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation%28int%29
Picture orientation from gallery/camera intent
但是这段代码
ExifInterface exif = new ExifInterface("filepath");
exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
在两个设备中总是给出 0。请告诉我我是否知道图像在显示时以特定设备的哪个角度显示,以便它将应用于所有设备,一旦我得到它的角度,我将自己旋转。提前致谢。
【问题讨论】:
-
这是我对这个问题的解决方案; stackoverflow.com/a/8864367/137404
标签: android android-intent imageview