Skip to content

Commit

Permalink
trying to fix svg with image spec (fuzhenn#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn authored Aug 5, 2020
2 parents 0f3c0e4 + f27c222 commit bf69a4a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"expect.js": "^0.3.1",
"mocha": "^8.1.1",
"node-base64-image": "^2.0.1",
"node-base64-image": "^1.0.7",
"should": "^13.2.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Convert SVG', function () {

it('convert a svg with an image', function (done) {
this.timeout(5000);
var imageUrl = 'https://zh.wikipedia.org/static/images/project-logos/zhwiki-hans.png';
var imageUrl = 'https://res.cloudinary.com/verticalaxisbd/image/upload/h_239,w_239/rg1kxkgxayhdgoqdaejz.jpg';
Image64.encode(imageUrl, {}, function (err, base64) {
var svgString = util.format('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="540" height="258" ' +
'viewBox="0 0 540 258"><image width="540" height="258" x="0" y="0" href="%s"></image></svg>', 'data:image/png;base64,' + base64.toString('base64'));
Expand Down
Binary file added test/zhwiki-hans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf69a4a

Please sign in to comment.