iPhone AVFoundation camera orientation

前端 未结 12 578
走了就别回头了
走了就别回头了 2020-12-02 09:46

I\'ve been tearing my hair out trying to get the AVFoundation camera to capture a picture in the correct orientation (i.e. the device orientation) but I can\'t get it to wor

12条回答
  •  [愿得一人]
    2020-12-02 10:52

    You can also create an intermediate CIImage, and grab the properties dictionary

    NSDictionary *propDict = [aCIImage properties];
    NSString *orientString = [propDict objectForKey:kCGImagePropertyOrientation];
    

    And Transform accordingly :)

    I love how easy it is to access all this image metadata in iOS5!

提交回复
热议问题