How to get a correctly rotated UIImage from an ALAssetRepresentation?

后端 未结 1 413
既然无缘
既然无缘 2020-12-19 14:19

I’m trying to get a correctly rotated UIImage from an ALAssetRepresentation using the fullScreenImage method. I have several testing p

相关标签:
1条回答
  • 2020-12-19 14:57
    ALAssetRepresentation *rep = [asset defaultRepresentation];
    UIImage *img = [UIImage
        imageWithCGImage:[rep fullScreenImage]
        scale:[rep scale]
        orientation:UIImageOrientationUp];
    

    Is correct as under iOS 5 the fullscreenimages is already rotated (so it’s always “up”). Under iOS 4 the behaviour is different. Please see Orientation does not behave correctly with Photo in ALAsset for a more in depth explanation.

    0 讨论(0)
提交回复
热议问题