kozakdenys / qr-code-styling

Automaticly generate your styled QR code in your web app.
https://qr-code-styling.com
MIT License
1.55k stars 496 forks source link

Center image not rendering on NodeJs #258

Open BuyMyBeard opened 1 week ago

BuyMyBeard commented 1 week ago

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.

lb-ovc commented 22 hours ago

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.