docs: function detectVerticalSquash(img) {
      // 拍照在IOS7或以下的机型会出现照片被压扁的bug
      var data;
      var ih = img.naturalHeight;
      var canvas = document.createElement('canvas');
      canvas.width = 1;
      canvas.height = ih;
      var ctx = canvas.getContext('2d');
      ctx.drawImage(img, 0, 0);
      try {
          data = ctx.getImageData(0, 0, 1, ih).data;
      } catch (err) {
          console.log('Cannot check verticalSquash: CORS?');
          return 1;
      }
      var sy = 0;
      var ey = ih;
      var py = ih;
      while (py > sy) {
          var alpha = data[(py - 1) * 4 + 3];
          if (alpha === 0) {
              ey = py;
          } else {
              sy = py;
          }
          py = (ey + sy) >> 1; // py = parseInt((ey + sy) / 2)
      }
      var ratio = (py / ih);
      return (ratio === 0) ? 1 : ratio;
  }