ushelp / EasyQRCodeJS-NodeJS

EasyQRCodeJS-NodeJS is a NodeJS server side javascript QRCode image(PNG/JPEG/SVG/Base64 data url) generator. Support setting Dot style, Logo, Background image, Colorful, Title and more. Support binary(hex) data mode.
https://easyproject.cn/easyqrcode
MIT License
103 stars 53 forks source link

toSVGText() fails to output with png logo #12

Closed aBigSchwein closed 3 years ago

aBigSchwein commented 3 years ago

Having an issue with toSVGText() not outputting with the logo:

`import QRCode from 'easyqrcodejs-nodejs';

var options = { text: 'http://www.example.com/test', width: 315, height: 315, colorDark: '#000000', colorLight: '#FFFFFF', dotScale: 1, PO: '#000000', PI: '#000000', AO: '#000000', AI: '#000000', logo: 'https://www.example.com/img/logo.png', logoWidth: 59, logoHeight: 59 } var qrcode = new QRCode(options);

//Image Logo visible in result image data var dataURL = await qrcode.toDataURL();

//Image Logo not visible in result svg object var dataSVG = await qrcode.toSVGText();`

In this example dataURL is a perfect image with qr code and logo, but dataSVG is a perfect qr code, but the space where the logo image should be it is just blank... any idea why this might be happening?

ushelp commented 3 years ago

Note: SVG format use image tag(ns1:href) to load logo by URL, not write logo data in SVG data.

So please check your SVG QRCode can be accessed Logo URL correctly.

ushelp commented 3 years ago

Closed wihtout comments for a long time.