记一下获取图片宽高的方法
function getMeta(url) {
var img = new Image();
img.onload = function () {
let { width, height } = img;
console.log('{width, height} :>> ', { width, height });
};
img.src = url;
}
getMeta("https://www.xxxx.com/images.png")