/*
* 读取图片尺寸信息
* */
export function testWidthHeight(file){

  return new Promise(function(resolve) {

    let width = 0
    let height = 0

    // 读取图片数据
    let image = new Image();
    image.onload=function(){
      file.width = image.width;
      file.height = image.height;
      resolve(file)
    };

    let reader = new FileReader();
    reader.onload = function (e) {
      let data = e.target.result;
      // 加载图片获取图片真实宽度和高度
      image.src= data;
    };

    reader.readAsDataURL(file);


  })


}
