I am capturing images from the camera using captureStillImageAsynchronouslyFromConnection
The images are being saved upside down. I tried saving the image using
UIImage *flippedImage = [UIImage imageWithCGImage:image.CGImage scale:image.scale orientation:UIImageOrientationUp]
but this orientation is only in the metadata and when I copy the data from the file to process it the processed images are upside down. (Quick look shows the originals upright, but the processed/filtered images are upside down).
What is the correct way to set the orientation for the video capturing?
I set the orientation on the video preview layer but that doesn't effect the captured data in the AVCaptureStillImageOutput
object's buffer.
I read the AVCaptureStillImageOutput
header but there doesn't seem to be an explanation of how to force the camera previews orientation to the image buffer.
e.g. - (AVMetadataObject *)transformedMetadataObjectForMetadataObject:(AVMetadataObject *)metadataObject connection:(AVCaptureConnection *)connection NS_AVAILABLE_IOS(6_0);
Thanks