Ipad camera in 90 degree rotated - ios

I've a landscape Ipad app (and portrait in iPhone) that opens up the camera to take a photo always rotated of 90 degrees.
It will happen since iOS 8.x.
the code is:
[self.importPopoverController presentPopoverFromRect:self.avatarImageView.frame
inView:self.avatarImageView
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
how can I fix that?

Related

UIScreen mainScreen.bounds returns the wrong resolution, even with Launch Images

I have been banging my head against this for a while and I just cannot seem to figure out what is causing this issue.
I have an iPad app that runs only in landscape mode. I need to support both 1024x768 and 2048x1536 resolution screens, and define a viewport and protection for opengl using the device's screen resolution.
This all works fine on 1024x768 devices
However when running on 2048x1536 devices, [UIScreen mainScreen].bounds is still returning 1024x768
I am only targeting iOS 7.0 and later, and I have an asset library set up with launch images. I have even included launch images for portrait mode just to be safe.
I have 4 launch images (which are just white pngs):
iPad Portrait iOS 7,8 1x: 768x1024
iPad Portrait iOS 7,8 2x: 1536x2048
iPad Landscape iOS 7,8 1x: 1024x768
iPad Landscape iOS 7,8 2x: 2048x1536
Still, when the application launches, I am getting the wrong screen dimensions, so my OpenGL view only takes up 1/4 of the entire screen
Any help would be GREATLY appreciated
EDIT:
I modified the launch images so I could see which one it is using, and it is using the 2x Landscape image, as expected, but still the returned resolution is incorrect.
Sizes in iOS are calculated in points. Depending on the device, your scale might be different. [UIScreen mainScreen].scale will return the scale.
Its not recommended that you actually use the resolution of the screen, but instead use the bounds so that the device will automatically render everything with its proper scale.
Furthermore, the iPhone 6 Plus is downscaled, so getting the scale and multiplying the bounds will not give you a proper screen resolution.
You can find the correct size by the following line of code.
[[UIScreen mainScreen] currentMode].size;

Stop automatic Zbar camera rotation

I'm using a zbar reader view controller and when I rotate the iPhone quickly enough that Portrait (up) goes straight to Portrait Upside Down (and vice versa) or I go straight from Landscape Left to Right (and vice versa) then the camera rotates 180 degrees. I am using IOS 6, 7 and 8 and am using Objective C.
How do I prevent this camera rotation from happening?

Flash CameraUI orientation is wrong

We're developing an AIR app for android and iOS. An important part of the app is taking photos. Using flash.media.CameraUI works perfectly on android, but we experience problems on iOS.
In the iOS camera application, when we rotate the iPad, the orientation is wrong: If we rotate the pad clockwise, the image is rotated anticlockwise. The UI buttons have the correct orientation though, and when the photo is taken, the resulting bitmap has the right orentation based on the orientation of the camera, not the actual view on the screen.
Looking at different camera apps, I notice that when the pad is rotated so the orientation changes clockwise, the camera does three things: First, the displayed image immediately becomes rotated 90 degrees anti-clockwise (so it looks wrong). Then, the image slowly rotates 90 degrees clockwise, to restore the correct orientation. In addition, the UI buttons change orientation so the text is displayed correctly.
It seems as in our app, it only rotates the image slowly without doing the first immediate rotation. Thus, the end result is wrong.
Anyone know how to fix this?
After some more research, I found that the issue isn't just restricted to AIR.
UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

HTML5 Canvas Graphics and Animation

We are build a HTML 5 website. One feature is to use Canvas to resize images on Iphone/IPAD before uploading to our server.
On IPhone 4S and 5, when photos are taken in landscape mode with FRONT camera, the resizing works fine. When taken in portrait mode, the images are squashed by about 1/4. But when taken with rear camera, all images, both landscape and portrait, are squashed by about 7/8, leaving just a thin belt to view.
On IPAD and IPOD, it is the same for front and rear camera: landscape images are fine, but portrait images are squashed by 1/4.
We tried several different resizing algorithms, but ended up with the same results. Any thoughts on how to solve this problem?

IOS Preview in landscape with correct zoom

Who can give me an minimal example in IOS 5 or higher
of an app that captures the video of the backside cam with the following requirements:
The resolution of the image captured by the camera is 1280x720
The preview layer is a AVCaptureVideoPreviewLayer and fills the full screen on both IPhone 5 and 4
The orientation of both video and preview is LandScapeRight
If I want to zoom the preview, I correctly zoom into the center of my landscape image
I got everything working until 4.). But everytime I try to apply the zoom with
viewLayer.affineTransform = CGAffineTransformMakeScale(2, 2);
I observe that in landscape orientation the center of the focused image is left below the center of the unzoomed image. That is the problem I am trying to solve. So if I set the scale to 1, 1.3, 1.6 or 2.0 I want to always see the center of my unzoomed image.

Resources