Skip to content

Commit

Permalink
SVG logo image can not show bug fixed.
Browse files Browse the repository at this point in the history
SVG logo image can not show bug fixed.
  • Loading branch information
ushelp committed Aug 13, 2021
1 parent b53cdfe commit 3a645bf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/easy.qrcode.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easyqrcodejs",
"version": "4.4.3",
"version": "4.4.4",
"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)",
"main": "dist/easy.qrcode.min.js",
"scripts": {},
Expand Down
3 changes: 2 additions & 1 deletion src/canvas2svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,8 @@
}
svgImage.setAttribute("transform", translateDirective);
svgImage.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
image.nodeName === "CANVAS" ? image.toDataURL() : image.getAttribute("src"));
// image.nodeName === "CANVAS" ? image.toDataURL() : image.getAttribute("src"));
image.nodeName === "CANVAS" ? image.toDataURL() : image.originalSrc);
parent.appendChild(svgImage);
}
};
Expand Down
5 changes: 3 additions & 2 deletions src/easy.qrcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* 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)
*
* Version 4.4.3
* Version 4.4.4
*
* @author [ inthinkcolor@gmail.com ]
*
Expand Down Expand Up @@ -1513,6 +1513,7 @@
if (_htOption.crossOrigin != null) {
bgImg.crossOrigin = _htOption.crossOrigin;
}
bgImg.originalSrc = _htOption.backgroundImage;
bgImg.src = _htOption.backgroundImage;
// DoSomething
} else {
Expand Down Expand Up @@ -1796,9 +1797,9 @@
if (_htOption.crossOrigin != null) {
img.crossOrigin = _htOption.crossOrigin;
}
img.originalSrc = _htOption.logo;
img.src = _htOption.logo;


} else {
drawQuietZoneColor();
this._bIsPainted = true;
Expand Down

0 comments on commit 3a645bf

Please sign in to comment.