wxml-to-canvas icon indicating copy to clipboard operation
wxml-to-canvas copied to clipboard

iphone8 生成带图片的海报失败, 微信版本号: 8.0.7, 调试库:2.16.1

Open kiprunning opened this issue 4 years ago • 2 comments

tmp/YEBHErVHQ86De13348d5ef2982c193d1becaefde55e5.jpg#devtools_no_referrer:1 GET http://tmp/YEBHErVHQ86De13348d5ef2982c193d1becaefde55e5.jpg net::ERR_PROXY_CONNECTION_FAILED(env: macOS,mp,1.05.2105170; lib: 2.16.1) Image (async) set src @ VM380:1 _drawImage @ index.js? [sm]:623 success @ index.js? [sm]:641 forEach.u. @ VM389 WAService.js:2 d @ VM389 WAService.js:2 (anonymous) @ VM389 WAService.js:2 p @ VM389 WAService.js:2 (anonymous) @ VM389 WAService.js:2 d @ VM389 WAService.js:2 (anonymous) @ VM389 WAService.js:2 (anonymous) @ VM389 WAService.js:2 value @ VM389 WAService.js:2 B @ VM389 WAService.js:2 (anonymous) @ VM389 WAService.js:2 (anonymous) @ VM389 WAService.js:2 c @ VM8 asdebug.js:1 u @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 f @ VM8 asdebug.js:1 g @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 _ws.onmessage @ VM8 asdebug.js:1 share.js? [sm]:144 ****error: Error: createImage fail: http://tmp/YEBHErVHQ86De13348d5ef2982c193d1becaefde55e5.jpg at HTMLImageElement.Image.onerror (index.js? [sm]:622)

kiprunning avatar Jul 13 '21 08:07 kiprunning

降到1.0.1版就可以,最新的1.1.1会有问题

shiyuanzheng avatar Aug 21 '21 07:08 shiyuanzheng

该组件在小程序库版本>=2.9.2时,会自动使用2d同层渲染的canvas,同时图片会使用 canvas.createImage()来加载,但是这种加载方式不支持wx.downloadFile后的临时地址,所以会加载失败; 详情见下图源码: image

源码修改: image

(不保证后续更新,只做参考) 修正后的npm包: npm install --save jassybao-wxml-to-canvas

修正后的github地址: https://github.com/jassybao/wxml-to-canvas

jassybao avatar Apr 09 '22 03:04 jassybao