Not able to show the Image in proper format from camera in landscape mode

ios, ios-simulator, ipad, iphone, uiimagepickercontroller

Solution

You can try giving transform to your imagePickerController

imagePickerController.view.transform = CGAffineTransformMakeRotation(-M_PI/2);

Problem

I am working on iPad App in Ios6, There when we click the right bar button i am giving an action like below: ``` -(IBAction)camerabuttonAction:(id)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.delegate = self; self.popoverController = [[UIPopoverController alloc] initWithContentViewController:picker]; [self.popoverController presentPopoverFromRect:CGRectMake(50, -250, 500, 300) inView:appDelegate.splitview.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; } ``` My problem is, When i am in Land scape mode if i click the button. The camera show in portrait mode(Image appears in reverse mode to see) after every second use. But, if i shake the iPad then it shows in LandScape i.e, in correct direction . see the below images When i am in Land scape mode if i click the button camera shows the image like below: if i shake the iPad then camera shows the image like below: I have tried a lot and googled,but I did not find any solution. It's killing my time so if any one have worked on it please guide me and post sample code.

Original source

Related problems