fix: listen for error event on image (#2736)
parent
2fd4b27ec6
commit
ca66fae3ef
|
@ -132,6 +132,9 @@ function createResizedImage(
|
||||||
ctx.drawImage(img, 0, 0, w, h)
|
ctx.drawImage(img, 0, 0, w, h)
|
||||||
resolve(canvas.toDataURL('image/jpeg', quality))
|
resolve(canvas.toDataURL('image/jpeg', quality))
|
||||||
})
|
})
|
||||||
|
img.addEventListener('error', ev => {
|
||||||
|
reject(ev.error)
|
||||||
|
})
|
||||||
img.src = dataUri
|
img.src = dataUri
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue