七牛IOS和数码相机竖排,图片旋转问题处理
2017-12-06 17:45
323 查看
思路:
针对获取原信息中含有(orientation)参数,值为Right-top和Left-bottom会被旋转:
方法一:?imageView2/0/format/jpg,给图片统统加后缀(简单粗暴)
方法二:?imageMogr2/auto-orient,通过判断orientation,加此后缀,防止放入img标签图片转向:
js处理思路如下(java同理):
针对获取原信息中含有(orientation)参数,值为Right-top和Left-bottom会被旋转:
{"size":1640252,"format":"jpeg","width":3456,"height":2304,"colorModel":"ycbcr","orientation":"Left-bottom"}
方法一:?imageView2/0/format/jpg,给图片统统加后缀(简单粗暴)
方法二:?imageMogr2/auto-orient,通过判断orientation,加此后缀,防止放入img标签图片转向:
js处理思路如下(java同理):
function getImageFormat(key) { var img = ""; $.ajax({ type: "get", async : true, dataType: "json", url: imagePrefix+key+"?imageInfo", success: function (data) { var orientation = data.orientation; if(typeof(orientation) != "undefined"){ if(orientation == "Right-top" || orientation == "Left-bottom"){ img = imagePrefix+key+"?imageMogr2/auto-orient"; //或者img = imagePrefix+key+"?imageView2/0/format"; } } } }); }
相关文章推荐
- IOS应用开发-图片处理(拉伸图片 创建缩略图 解决图片旋转的问题 图片编码及上传 将图片写入磁盘)
- IOS应用开发-图片处理(拉伸图片 创建缩略图 解决图片旋转的问题 图片编码及上传 将图片写入磁盘)
- IOS 处理多张图片内存问题
- cordova的camera插件,IOS下图片旋转问题
- iOS开发 UIimage旋转,得到旋转后的Image图片,解决imageView旋转,内部图片不跟着旋转问题
- iOS自定义相机截取图片旋转90°的问题
- 处理图片的旋转问题bug
- 第35篇 IOS-WebRTC BUG处理(三)之问题图片导入及本地运行两个nodejs
- iOS图片上传后被旋转的问题
- Android:Camera的使用,并处理手机拍照后上传图片被旋转的问题
- 图片压缩保存 处理三星拍照图片旋转问题的部分方法
- iOS:图片的旋转方向问题
- ios UIImageView处理图片大小问题
- iOS保存系统相册中的照片到应用沙盒中出现的问题--图片旋转90度,使用CGImageRelease造成应用崩溃
- iOS下html上传图片被旋转问题
- [iOS]关于从相册选取的图片方向问题的处理
- JS解决IOS中拍照图片预览旋转90度BUG的问题
- pil 处理iso图片旋转问题
- vue之图片上传解决图片压缩和ios拍摄的角度旋转的问题
- iOS旋转图片锯齿问题