UIImage *tempImage = [UIImage imageWithCGImage:imageRef];
NSLog(@"--- %d",tempImage.imageOrientation);
//需要按照旋转后的方向重置图片的方向
UIImage *croppedImage = [UIImage imageWithCGImage:imageRef scale:1.0 orientation:UIImageOrientationRight];
NSLog(@"--- %d",cropped.imageOrientation);
CGImageRelease(imageRef);
//获得图片的data
NSData *data = UIImageJPEGRepresentation(croppedImage, 0.5);
这个时候把data上传到服务器,返回的链接找到的图片始终是up方向的,这是为什么!上传图片之前我已经修改图片的方向了啊
备注:安卓的同事,旋转之后上传图片就是正常的,这个应该是我们客户端的问题吧!