1.利用canvas转换格式 思路很简单,就是在canvas上drawImage,然后再把canvas转换成想要的图片格式 convertImageToCanvas = (image) => { //image一定是一个图片对象,不然获取不到宽高 var canvas = document.createElement(canvas); // 新建canvas对象 canvas.width = image.width; canvas.height = image.height; canvas.getContext(2d).drawImage(image, 0, 0); ret