拍摄的照片上传之后旋转如何解决?
2015-11-23 14:06
281 查看
在上传之前先把图片调到正确的位置。
1 - (UIImage *)normalizedImage { 2 if (self.imageOrientation == UIImageOrientationUp) return self; 3 4 UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale); 5 [self drawInRect:(CGRect){0, 0, self.size}]; 6 UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext(); 7 UIGraphicsEndImageContext(); 8 return normalizedImage; 9 }
详情参考:http://feihu.me/blog/2015/how-to-handle-image-orientation-on-iOS/
相关文章推荐
- html图标插件
- oracle 查看表的相关信息
- esc设置多站点 域名解析
- 合并委托(多路广播委托)
- 打包apk
- 121 Best Time to Buy and Sell Stock
- oracle 连接 web service (利用soap_api)
- spring框架学习(一)
- python codeforces 322 div2 C
- oracle 分区表的建立方法
- 移动端背景图片铺满屏幕
- 联通编码问题
- JAVA 3DES加密解密
- 浏览器架构
- linux block层的class diagram
- angularJS学习之路(十二)---{{}}发生屏幕闪烁问题
- Java - 文件(IO流)
- RESTful API 设计指南
- ios9适配系列教程
- 对称加密和分组加密中的四种模式(ECB、CBC、CFB、OFB)