js将url转blob的一种思路
将HTML页面的图片(url)转化为文件对象(blob)进行处理,又不想通过a标签download下载时,可以通过发送请求图片地址转化为blob再进行处理
fetch(url)
.then(response => response.blob())
.then(res => {
// 处理res
})
将HTML页面的图片(url)转化为文件对象(blob)进行处理,又不想通过a标签download下载时,可以通过发送请求图片地址转化为blob再进行处理
fetch(url)
.then(response => response.blob())
.then(res => {
// 处理res
})