Closed sarvaje closed 6 years ago
If I change to canvas everything works as expected (any 1.6.x version).
Are you sure? I don't think that was implemented until Automattic/node-canvas#1193. canvas@next
or canvas-prebuilt@next
This is working fine with version 1.6.11.
But just for the record:
Are you sure? I don't think that was implemented until Automattic/node-canvas#1193. canvas@next or canvas-prebuilt@next
Sorry, I though that src
was supported in all the versions, but in fact I was using this code:
const dataURL = require("data-urls");
const data = dataURL('data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
const Canvas = require('canvas-prebuilt');
const image = new Canvas.Image();
image.onerror = function (e) {
console.log(e);
}
console.log('before');
image.source = data.body;
console.log('after');
I was expecting an error, but the script finished suddenly in image.source = data.body
.
But as I said, this is an issue from the past :)
Thanks!!
Oops, you're right, I was thinking of http-style URLs. Glad that fixed it for you.
When you run this code, the process break without any error.
Expected output:
Current output:
If I change to
canvas
everything works as expected (any 1.6.x version).It works with version 2.0.0-alpha.13 but I can't use it because it is use in
jsdom
and they don't support version 2 yet.Maybe this will be fixed after https://github.com/node-gfx/node-canvas-prebuilt/issues/51 is done.