获取图片尺寸(宽高)
function getImageDimensions(url) {return new Promise((resolve, reject) > {const img new Image();img.onload function() {resolve({width: this.naturalWidth,height: this.naturalHeight});};img.onerror reject;img.src url;});
}// 使用示例
getImageDimension…
2026/7/10 17:25:22