可以使用Image对象来获取图片的像素大小,代码如下:var img = new Image()img.src = base64;(图片的base64编码字符串)img.height即为图片的高度img.width即为图片的宽度