UIImagePicker force photo in portrait mode (disable accelerometer) - iphone

I'm building an application which takes photos using the UIImagePickerController. Works great.
The problem however is that I don't want to use image rotation. I always want a photo in portrait mode just as the user sees it on the screen.
When you take your iPhone on the side and then slowly take it back to normal the orientationmode isn't updated. Now when you take the photo the orientation flags in the EXIF data are set.
Is there a way to get rid of orientation support in de imagepicker? Could I just disable the accelerometer?

Related

Play youtube full screen on landscape, but inline on portrait - on iPhone

I have a view with a UIWebView on half the size of the iPhone screen.
In this webview I embed youtube videos.
The app is only in portrait mode. Though I would like to see videos play also in landscape.
Now I want the following behaviour:
When in portrait, play inline, don't go full screen.
a. For that I use "webView.allowsInlineMediaPlayback=YES;"
b. I open the webview with this link: "www.youtube.com/embed/videoid?playsinline=1"
If the user rotates the screen to landscape, I'd like the video to go full screen.
If the user then rotates back to portrait, I'd like the video to get inline again.
The rotations shouldn't stop the video in the middle, or restart the play.
What should I do?
As the embedded videos use an undocumented MPInlineVideo(Fullscreen)ViewController, you can't use its API and switch to fullscreen.
I'd thus recommend playing around with the "allowFullScreen"-parameter for the iframe-tag.
If everything fails, you should always be able to change the frame-size of the web-view so that it covers the full screen. You'd have to use width/height 100% in the iframe then.
Disclaimer: This is an educated guess. I've not actually tried to implement it that way.

Correcting Video Orientation in iOS

I am developing a video app in which user can merge different videos present in Asset Library. I am able to join the videos but I am facing the orientation issues.
For example, if a video is landscape right and other is landscape left, the second video will be joined upside down. Moreover, I have tried different codes available at stackExchange, however if i apply those codes to portrait videos, they can be transformed to landscape right but leaving black margins on the sides.
Is there any way that when I select a video to be inserted in my project, first its orientation should be checked, if it is other then landscape right, it should be rotated accordingly and in the end if the original video was portrait, the video should be resized as the native player do when we play a video in full screen mode.
Thanks in advance.

AVCapture not working well with retina screen

I am trying to use AVCapture in my app to capture the image and post it to a server, but I have a problem with this framework:
With a normal iPhone screen, this framework work very well, but with a retina screen, the AVCamera doesn't work well: The iPhone's video is zooming in to the target higher than the camera, so my camera is too close to the object I want to shoot.
I researched this and saw that the retina device's default camera has this problem too. The image camera and the video camera have different scale zooming, and the AVCamera probably uses the video camera so the target is higher than the image camera. But I want to take the picture with the image camera with AVCapture, how can i do it?

Orientation for Photo Captured by Camera Intent

I've captured several images from the Camera by launching it with an intent.
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
When I display the image in a view after I capture it, it's orientation is always landscape, regardless of it being captured in portrait or otherwise. I expect this based on what I've read on this forum.
However, when I look at it in the Gallery App or from the File Manager, it's displayed in it's correct orientation.
How does the Gallery App know what the capture orientation was? I would like access to that same information, but it doesn't appear to be in the ExifInterace or the ContentResolver.

iPhone Camera pictures from UIImagePickerController are sideways

My application supports taking pictures from iPhone in portrait mode and upload to the server.
However, the pictures taken are appearing in sideways once uploaded to the server.
Please help!
-KC
Keep in mind that the image has an associated imageOrientation property that will determine the correct orientation to display the image.
Images captured used AV Foundation (at least using AVCapture, which I'm using) are taken in landscape mode, so you have to rotate them clockwise before sending to the server.