qr-code-styling icon indicating copy to clipboard operation
qr-code-styling copied to clipboard

Center image not rendering on NodeJs

Open BuyMyBeard opened this issue 1 year ago • 3 comments

When we provide Qr Code an image with a base64 encoded data uri, no image is rendered in the middle of the QR Code using nodejs.

I have personally tried to debug the problem, but it is very hard to diagnosticate the problem, since this fails silently. This could very well be a problem with the jsdom or canvas libraries. The issue arises when the QR Code tries to convert the qrSVG to base64 and loads it in the canvas. The tag containing the center image does not render an image on nodejs.

I found multiple relevant issues, mainly #163.

This was first implemented 3 years ago in #43 and was recently fixed in #241. I'd be curious if this was working prior. From looking at the nodejs example, it originally tried to load the image with an xml http request, and the image was linked directly from a web http url, but that code was removed in #241.

Either way, trying to load an image, either locally, remotely, or directly with a data base64 encoded uri doesn't work anymore. I'd like to know if this is a regression caused by this package or by canvas.

BuyMyBeard avatar Nov 14 '24 17:11 BuyMyBeard

We are experiencing the same issue. It does load after refreshing the browser tho.

@BuyMyBeard Could you try version 1.6.0? It seems to be working in that version.

lb-ovc avatar Nov 21 '24 13:11 lb-ovc

We are experiencing the same issue. It does load after refreshing the browser tho.

You refresh your browser in NodeJS? how do you do that?

BuyMyBeard avatar Nov 25 '24 22:11 BuyMyBeard

@BuyMyBeard Could you try version 1.6.0? It seems to be working in that version.

I have tried making a repro with [email protected] but it couldn't compile because it wasn't compatible with [email protected] and canvas @2.11.2.

How'd you get it to work in that version? I could revert the version of canvas and jsdom but I dont want to have to compile the cairo backend on my windows machine.

BuyMyBeard avatar Nov 26 '24 19:11 BuyMyBeard