Camera Orientation Change When Picture Taken. Even When Orientation is locked.
Asked Answered
A

2

6

I have an app that takes pictures. I want the orientation of the camera view to change when the device is rotated so the picture comes out in the correct orientation that it was taken as. I want this to work even when the device orientation is locked. What is the best way to go about doing this? Accelerometer/Core Motion? Advice and tutorials are much appreciated.

Arteritis answered 11/11, 2014 at 7:49 Comment(1)
Did you find a solution for this problem? The system Camera app does it correctly - if orientation is locked, the taken photo is saved with the correct physical orientation, even though the UIDevice orientation is "wrong", and the UI still rotates when rotating the device. How to do this in a custom app? I want to avoid having to ask the user for CoreMotion permissions...Justiceship
B
-1

Just an initial thought, have you considered rotating the picture after it's taken? I'm not sure whether this is the right solution for you as the display will still be oriented on the side when the photo is being taken. this would certainly get around the screen locking issue.

I hope this helps. Kiran

Bourse answered 11/11, 2014 at 7:58 Comment(4)
I thought a little bit about doing that.. Would this be a better way to do it? If so, how would I implement this?Arteritis
Does this help? #6694027Bourse
It shows how to translate a photograph i think is what you need. up vote my answer. If not then we can discuss it further i am not an iphone app developer but i have been developing for many years so i'm sure we can get to the bottom of your problemBourse
Does not help, as the UIDevice orientation is still portrait, when orientation lock is active.Justiceship
J
0

Seems like there is no way around CoreMotion. Reading out x/y accelerometer data is enough for determining the orientation. This blog post gives a good introduction: http://nshipster.com/cmdevicemotion/

Justiceship answered 12/1, 2017 at 11:45 Comment(0)
B
-1

Just an initial thought, have you considered rotating the picture after it's taken? I'm not sure whether this is the right solution for you as the display will still be oriented on the side when the photo is being taken. this would certainly get around the screen locking issue.

I hope this helps. Kiran

Bourse answered 11/11, 2014 at 7:58 Comment(4)
I thought a little bit about doing that.. Would this be a better way to do it? If so, how would I implement this?Arteritis
Does this help? #6694027Bourse
It shows how to translate a photograph i think is what you need. up vote my answer. If not then we can discuss it further i am not an iphone app developer but i have been developing for many years so i'm sure we can get to the bottom of your problemBourse
Does not help, as the UIDevice orientation is still portrait, when orientation lock is active.Justiceship

© 2022 - 2024 — McMap. All rights reserved.