File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,15 @@ function svgToImg(opts) {
25
25
26
26
var ctx = canvas . getContext ( '2d' ) ;
27
27
var img = new Image ( ) ;
28
- var DOMURL = window . URL || window . webkitURL ;
29
- var svgBlob = new Blob ( [ svg ] , { type : 'image/svg+xml;charset=utf-8' } ) ;
30
- var url = DOMURL . createObjectURL ( svgBlob ) ;
28
+
29
+ var base64Svg = 'data:image/svg+xml,' + encodeURIComponent ( svg ) ;
31
30
32
31
canvas . height = opts . height || 150 ;
33
32
canvas . width = opts . width || 300 ;
34
33
35
34
img . onload = function ( ) {
36
35
var imgData ;
37
36
38
- DOMURL . revokeObjectURL ( url ) ;
39
37
ctx . drawImage ( img , 0 , 0 ) ;
40
38
41
39
switch ( format ) {
@@ -68,7 +66,6 @@ function svgToImg(opts) {
68
66
} ;
69
67
70
68
img . onerror = function ( err ) {
71
- DOMURL . revokeObjectURL ( url ) ;
72
69
reject ( err ) ;
73
70
// eventually remove the ev
74
71
// in favor of promises
You can’t perform that action at this time.
0 commit comments