开发者

ALAssetRepresentation fullResolutionImage's UIImageOrientation is wrong

开发者 https://www.devze.com 2023-01-15 03:01 出处:网络
I\'m trying to ALAssetLibrary to fetch pictures in Photos app, but recently I found a problem, when I get the CGImageRef from ALAssetRepresentation, the UIImageOrientation is wrong(rotated 90 degree),

I'm trying to ALAssetLibrary to fetch pictures in Photos app, but recently I found a problem, when I get the CGImageRef from ALAssetRepresentation, the UIImageOrientation is wrong(rotated 90 degree), but when I get width and height from the CGImageRef, they're wrong either, now how could I get the right CGImageRef or use开发者_Python百科 the CGImageRef to create a right UIImage?


Use the imageWithCGImage:scale:orientation: method of UIImage. And pass in the the ALAssetPropertyOrientation property of ALAsset for the orientation parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消