Flash CameraUI orientation is wrong - ios

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)

Related

Know if picture is Selfie or Portrait

I'm coding an app where users can upload pictures and add some filters to it.
The problem is that when I apply filter on it, the picture is rotating, ONLY if the picture has been taken with back camera.
If it was a selfie the picture is not rotating
If the picture is in portrait mode, the picture is not rotating
The problem is that I don't know how I could get these information, in order to rotate the picture only when I need it.
You're thinking about this the wrong way. It may be the case that images taken with your phone's rear camera appear rotated after applying a filter, but you cannot make this assumption for all devices. Instead, you can read the imageOrientation property on UIImage to obtain information about whether the image has an unusual rotation.

How can I have a camera on a defined part of the screen on iPhone 4/4S?

I am using the AVFoundation framework to have a camera view on my iPhone app.
On iPhone 5 and further, the camera fills the entire view where it's in. On iPhone 4/4S, the view isn't filled entirely and I get blank spaces on both sides of the view. I believe it's not because of the constraints, but because of the proportion of the iPhone's screen :
With the preset AVCaptureSessionPresetPhoto, on iPhone 5/6, the ratio of the image is 3/4. On iPhone 4/4S with the same preset, the ratio of the image is 9/16. It looks like the shape of my camera's view can be filled with a 3/4 image, not a 9/16 image.
So I looked for all the preset available, and I tried the preset AVCaptureSessionPreset640x480 thinking that the problem would be solved since 640*480 delivers a 3/4 image... But it didn't fixed anything, I still have blank spaces on both sides of the view.
Is there a way to adapt the resolution with the AVFoundation framework ?
(I think my problem would be easier to understand with images, but I'm not authorized to post some yet)
I didn't found a way to use the camera on the exact ratio i wanted, so I just created a new ViewController that I only use on the iPhone 4/4S, with a different interface for this device

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?

How do you capture full screen camera photos on iOS?

On Snapchat, it allows you to take a full screen camera photo on iOS. The preview is full screen, and the image returned is full screen. There appears to be no cropping/stretching/etc... What you see is what you get.
Now I've looked all over the place, and I can't figure out how this is actually being done, seeing that the iPhone camera always returns an image with an aspect ratio of 4:3. Yes, you can use the camera view transform to have a full screen "preview", but the image returned is still 4:3 and needs to be cropped.
So my question is, how do you take a full screen camera photo on iOS without cropping? If your answer is that it can't be done, then how is Snapchat doing it (or appearing to do it)?
Snapchat isn't displaying everything the camera is picking up. By cropping a bit from the top/bottom or sides, they can create a 16:9 image from a 4:3 image. This is easy to verify.
Open up the snapchat and camera apps so it's easy to switch between them.
Place your phone on its side pointed at something with some marks for reference points.
Switch between the apps without moving the phone. There is content that you do not see on Snapchat.

Getting the full camera view

When your taking a photo with a camera, your not getting all the camera view right?
I mean in a portrait photo take
I will have much more hight then a landscape photo:
Where ill have much more width, right?
But the camera is a circle so that means the the image can be actuality taken with a larger area, I mean the hight and the width together!
The camera is probably getting the hole image, but cropping it according to the screen, landscape or portrait.
If i would like to get the full image that the camera is getting, how can i achieve that?
Any suggestions would be much appreciated, thanks!
Edit
After a long search that came out with nothing so far, even if someone knows about a way to display a landscape camera, in a portrait mode, that would help to.
What i mean is display a view were there is more to see on the left and right sids, hope i'm clear enough with my question..
Actually, the sensor has roughly the same proportions as the screen. Its aspect ration is around 1.33 (4/3) or maybe 1.5 (3/2), depends on the phone model. the only round thing in the camera is the lens that projects a circle of light around the sensor. When you rotate your phone the sensor is naturally rotated as well so you always get the full output in every shot.

Resources