Skip to content

Commit c936361

Browse files
committed
add visual test for #2498
1 parent b50b392 commit c936361

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/public/tests.js

+19
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ let Image
33
let imageSrc
44
const tests = {}
55

6+
/* global btoa */
7+
68
if (typeof module !== 'undefined' && module.exports) {
79
module.exports = tests
810
Image = require('../../').Image
@@ -2813,3 +2815,20 @@ tests['no exif orientation'] = function (ctx, done) {
28132815
}
28142816
img.src = imageSrc(`exif-orientation-fn.jpg`)
28152817
}
2818+
2819+
tests['scaling SVGs'] = function (ctx, done) {
2820+
const img = new Image()
2821+
2822+
img.onload = function () {
2823+
img.width = 200
2824+
img.height = 200
2825+
ctx.drawImage(img, 0, 0, 200, 200)
2826+
done()
2827+
}
2828+
2829+
img.src = 'data:image/svg+xml;base64,' + btoa(`
2830+
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
2831+
<circle fill="#ff0000" cx="50" cy="50" r="50"/>
2832+
</svg>
2833+
`)
2834+
}

0 commit comments

Comments
 (0)