0

我正在为 iPhone 拍摄的所有可能的图像和视频方向构建一个测试用例。

我使用原生 iOS 相机应用程序拍摄了所有 8 个可能的方向(上、下、左、右),但对于我正在运行的示例代码,它似乎都报告图像是

参考代码是printOrientationForName(@“UIImage”, image.imageOrientation); 工作示例,可以在这里找到Sugarso/Orientation

输出在这里

2014-05-04 15:42:39.651 Orientation[10293:60b] ASSET ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=E819189D-0696-4C94-8046-804CBF1551E8&ext=JPG
2014-05-04 15:42:39.661 Orientation[10293:60b] UIImage UIImageOrientationUp [0]
2014-05-04 15:42:39.663 Orientation[10293:60b] ASSET ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=19E29D06-96F2-4B35-A0EB-B2A809A02C79&ext=JPG
2014-05-04 15:42:39.665 Orientation[10293:60b] UIImage UIImageOrientationUp [0]
2014-05-04 15:42:39.667 Orientation[10293:60b] ASSET ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=265261C0-0479-41C4-BFDC-91AD6887A81F&ext=JPG
2014-05-04 15:42:39.668 Orientation[10293:60b] UIImage UIImageOrientationUp [0]
2014-05-04 15:42:39.669 Orientation[10293:60b] ASSET ALAsset - Type:Photo, URLs:assets-library://asset/asset.JPG?id=BE459DAE-0CFD-4D93-8050-5C62D9F5D0F9&ext=JPG
2014-05-04 15:42:39.670 Orientation[10293:60b] UIImage UIImageOrientationUp [0]

如您所见,所有图像都是使用 UIImageOrientationUp 创建的。我在检查错误的财产?还是相机应用程序会翻转所有照片?我应该如何使用给定的布局拍照。

4

1 回答 1

2

Depends on different things, for instance:

  • if you do not save them on the asset library along with their metadata and later you open them, they will load with the default orientation (UIImageOrintationUp)
  • if you save them as png, images don't have a knowledge about their orientation
  • the orientation is different if you load/shoot them with the picker, or delegate buffer, or still images

I wrote this post on my blog (Exif pain), maybe it will help to check your issue

于 2014-05-04T13:36:55.770 回答