kciter / qart.js

Generate artistic QR code. 🎨
https://kciter.github.io/qart.js/
GNU General Public License v3.0
3.15k stars 176 forks source link

Image background not working #27

Closed t3chguy closed 5 years ago

t3chguy commented 6 years ago

image

You can see code used to render both objects at the bottom

I copied the code from qrImage.onload to see whether it was failing to fetch the image but no, that bit works fine as can be seen

lunaroyster commented 6 years ago

+1

Experiencing the same issue, using VueJS/Webpack

chrislennon commented 6 years ago

@t3chguy @lunaroyster - Just an FYI I was working with this library on another project and encountered the same issue, I believe it can be worked around by commenting out Line 144/145 in the library - will investigate further the impact and if a patch can be made to the upstream.

Edited:

            var imageCanvas = _util2.default.createCanvas(imageSize - padding * 2, coverImage, self.fillType);
            coverImage.src = imageCanvas.toDataURL();

To:

            //var imageCanvas = _util2.default.createCanvas(imageSize - padding * 2, coverImage, self.fillType);
            //coverImage.src = imageCanvas.toDataURL();
t3chguy commented 6 years ago

No longer using this library because of this but maybe your suggestion will be useful to someone else

misteral commented 5 years ago

@t3chguy Hi, this is background example from here. It work for me. Alt text

SteMMo33 commented 4 years ago

I'm sorry but I have the same problem too. If I run the online example code with my image I have no problem (please take a look to the QRCode error..):

Screenshot (16)

but if I run the library on my page I have no background image - two samples in black - the code is copy-and-pasted from the example (only changed the imagePath param):

Screenshot (17)

If I open the 'Network' tab of the browser I don't see ant request for the image file! Any idea? Thanks!