zoukankan      html  css  js  c++  java
  • 解决IOS上传竖向照片会旋转90度的问题

    // 解决IOS上传竖向照片会旋转90度的问题
      rotate() {
        const that = this;
        that.imgOrientation = 1;
        let Orientation = null;
        const _filelist = $('#showImg')[0].files[0];
        $('.weui-uploader__file').removeClass('rotate-90');
        $('.weui-uploader__file').removeClass('rotate-180');
        $('.weui-uploader__file').removeClass('rotate-90-back');
        // 获取图片Orientation参数
        EXIF.getData(_filelist, function () {
          Orientation = EXIF.getTag(this, 'Orientation');
          that.imgOrientation = Orientation;
    
          if (Orientation) {
            switch (Orientation) {
              case 6:     // 正常竖拍
                $('.weui-uploader__file').addClass('rotate-90');
                break;
              case 3:     // 横线拍-180
                $('.weui-uploader__file').addClass('rotate-180');
                break;
              case 8:     // 竖向拍-180
                $('.weui-uploader__file').addClass('rotate-90-back');
                break;
              default:
                $('.weui-uploader__file').removeClass('rotate-90');
                $('.weui-uploader__file').removeClass('rotate-180');
                $('.weui-uploader__file').removeClass('rotate-90-back');
            }
          }
        });
      }
    
  • 相关阅读:
    Python 简单总结
    Python 简单总结
    Python 简介
    Python基础题
    Python基础题
    tDQSS
    parameter–precharge, tRCD and tRAS
    parameter–key parameters
    parameter -- tWR
    命令集
  • 原文地址:https://www.cnblogs.com/boreguo/p/13632259.html
Copyright © 2011-2022 走看看