问题描述
尝试使用画布绘制图像。 如果使用此图像会导致白色,如果使用其他图像,则效果很好。 请赐教。有没有 [1]:https://i.stack.imgur.com/TesBY.jpg(如果放大,就会出现图像...)
chrome.*
解决方法
找到了一个解决方法,在处理图像到绘图之前, 执行图像转换,猜测它会修复损坏的图像... 我终于这样解决了。
import * as imageConversion from 'image-conversion';
let compressIm = new Promise(resolve => {imageConversion.compress(imgObj,{
quality: 1,type: "image/jpeg",width: 800,height: 600,orientation:2,scale: 0.5,})
})