我目前有一个使用 ALAsssetsLibrary 来获取照片的应用程序。我已将照片放置到图像视图中,并且可以上传到服务器。拍了一些照片后在真机上测试时,我发现本来应该在人像中拍摄的照片变成了风景。
因此,我调用了不同的函数来获得这样的 CGImage:
UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage] scale:1.0 orientation:(UIImageOrientation)[representation orientation]];
第一次尝试,我用这个:
UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage]]
我认为具有比例和方向的那个可以给我正确的方向来拍摄照片。但它没有给我正确的解决方案。
我是否错过了生成正确照片方向所需的任何内容?