【发布时间】:2012-02-08 14:13:18
【问题描述】:
我目前有一个使用 ALAsssetsLibrary 来获取照片的应用。我已将照片放置到图像视图中,并且可以上传到服务器。拍了几张之后在真机上测试,发现本来应该拍人像的照片变成了风景。
因此,我调用了不同的函数来获取这样的 CGImage:
UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage] scale:1.0 orientation:(UIImageOrientation)[representation orientation]];
第一次试用,我用这个:
UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage]]
我认为带有比例和方向的那个可以为我提供正确的拍摄方向。但它没有给我正确的解决方案。
我是否遗漏了生成正确照片方向所需的任何内容?
【问题讨论】:
-
从设备拍摄的照片会出现此问题
标签: iphone image orientation alassetslibrary