Skip to content

Commit 3a645bf

Browse files
committed
SVG logo image can not show bug fixed.
SVG logo image can not show bug fixed.
1 parent b53cdfe commit 3a645bf

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

dist/easy.qrcode.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easyqrcodejs",
3-
"version": "4.4.3",
3+
"version": "4.4.4",
44
"description": "Cross-browser QRCode generator for pure javascript. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js, Svelte framework. Support binary(hex) data mode.(Running with DOM on client side)",
55
"main": "dist/easy.qrcode.min.js",
66
"scripts": {},

src/canvas2svg.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,8 @@
11481148
}
11491149
svgImage.setAttribute("transform", translateDirective);
11501150
svgImage.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
1151-
image.nodeName === "CANVAS" ? image.toDataURL() : image.getAttribute("src"));
1151+
// image.nodeName === "CANVAS" ? image.toDataURL() : image.getAttribute("src"));
1152+
image.nodeName === "CANVAS" ? image.toDataURL() : image.originalSrc);
11521153
parent.appendChild(svgImage);
11531154
}
11541155
};

src/easy.qrcode.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Cross-browser QRCode generator for pure javascript. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js, Svelte framework. Support binary(hex) data mode.(Running with DOM on client side)
55
*
6-
* Version 4.4.3
6+
* Version 4.4.4
77
*
88
* @author [ inthinkcolor@gmail.com ]
99
*
@@ -1513,6 +1513,7 @@
15131513
if (_htOption.crossOrigin != null) {
15141514
bgImg.crossOrigin = _htOption.crossOrigin;
15151515
}
1516+
bgImg.originalSrc = _htOption.backgroundImage;
15161517
bgImg.src = _htOption.backgroundImage;
15171518
// DoSomething
15181519
} else {
@@ -1796,9 +1797,9 @@
17961797
if (_htOption.crossOrigin != null) {
17971798
img.crossOrigin = _htOption.crossOrigin;
17981799
}
1800+
img.originalSrc = _htOption.logo;
17991801
img.src = _htOption.logo;
18001802

1801-
18021803
} else {
18031804
drawQuietZoneColor();
18041805
this._bIsPainted = true;

0 commit comments

Comments
 (0)