summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/Util.java
diff options
context:
space:
mode:
authorWei-Ta Chen <weita@google.com>2011-11-11 19:07:58 -0800
committerWei-Ta Chen <weita@google.com>2011-11-15 13:48:22 -0800
commite0bbb93f6a598206ecd6e09150d51eae64bd3507 (patch)
treedcd04dcce28bd93dc41c98b5659fc91babbffd19 /src/com/android/camera/Util.java
parent34238165cfdf04584587360dfcf21109bf09e144 (diff)
downloadLegacyCamera-e0bbb93f6a598206ecd6e09150d51eae64bd3507.tar.gz
LegacyCamera-e0bbb93f6a598206ecd6e09150d51eae64bd3507.tar.bz2
LegacyCamera-e0bbb93f6a598206ecd6e09150d51eae64bd3507.zip
Set the orientation of a panorama image.
The panorama image returned from the panorama library is oriented based on the natural orientation of the camera. We set an orientation in its EXIF header, so that the image can be displayed correctly. The orientation is calculated by compensating the device orientation and the camera orientation respective to the natural orientation of the device. Bug: 5603313 Change-Id: Id6907cb08a7ff77e44736f3c3cd1503e7a68d783
Diffstat (limited to 'src/com/android/camera/Util.java')
-rw-r--r--src/com/android/camera/Util.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java
index ba8a4f78..d6ebb0a5 100644
--- a/src/com/android/camera/Util.java
+++ b/src/com/android/camera/Util.java
@@ -350,6 +350,12 @@ public class Util {
return result;
}
+ public static int getCameraOrientation(int cameraId) {
+ Camera.CameraInfo info = new Camera.CameraInfo();
+ Camera.getCameraInfo(cameraId, info);
+ return info.orientation;
+ }
+
public static int roundOrientation(int orientation, int orientationHistory) {
boolean changeOrientation = false;
if (orientationHistory == OrientationEventListener.ORIENTATION_UNKNOWN) {