I'm currently developing my first iPhone application. I've implemented a custom camera view where the camera view is displayed through my regular view in a rectangle set by a frame:
AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
[captureVideoPreviewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
[captureVideoPreviewLayer setFrame:CGRectMake(viewLayer.frame.origin.x, viewLayer.frame.origin.y, viewLayer.bounds.size.width, viewLayer.bounds.size.height)];
This works good but when I try to take a picture and cutting it with the same rectangle the image rotates 90 degrees. I can't figure out why it does this.
Is there any way I could detect what my "camera window" sees and then crop my taken picture with the same window?