Uploading image on server, receiving rotated image

前端 未结 2 657
不思量自难忘°
不思量自难忘° 2020-12-11 11:19

In my application I want to upload the image to the server and retrieve the url of uploaded image to display it in the application. I send the NSData of image. Here is my co

2条回答
  •  北海茫月
    2020-12-11 11:38

    This worked for me when using images from the the Photo library.

    ALAssetRepresentation *rep = [_asset defaultRepresentation];
    CGImageRef iref = [rep fullResolutionImage];
    UIImage* img = [UIImage imageWithCGImage:iref scale:1.f orientation:UIImageOrientationUp]
    

    Note: _asset is an instance of ALAsset.

提交回复
热议问题