根据原图,计算一个宽或高最大100的图片的计算方法
const previewImageRatio = previewImageWidth / previewImageHeight; // 原图宽高比例 let thumbnailHeight,thumbnailWidth;// 缩略图高和宽 if(previewImageRatio > 1){ thumbnailWidth = 100; // 缩略图宽度固定为 100 thumbnailHeight = thumbnailWidth / previewImageRatio; }else{ thumbnailHeight = 100; thumbnailWidth = thumbnailHeight * previewImageRatio; }