File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ function svgToImg(opts) {
17
17
var promise = new Promise ( function ( resolve , reject ) {
18
18
19
19
var Image = window . Image ;
20
- var Blob = window . Blob ;
21
20
22
21
var svg = opts . svg ;
23
22
var format = opts . format || 'png' ;
@@ -26,6 +25,9 @@ function svgToImg(opts) {
26
25
var ctx = canvas . getContext ( '2d' ) ;
27
26
var img = new Image ( ) ;
28
27
28
+ // for Safari support, eliminate createObjectURL
29
+ // this decision could cause problems if content
30
+ // is not restricted to svg
29
31
var base64Svg = 'data:image/svg+xml,' + encodeURIComponent ( svg ) ;
30
32
31
33
canvas . height = opts . height || 150 ;
@@ -74,7 +76,7 @@ function svgToImg(opts) {
74
76
}
75
77
} ;
76
78
77
- img . src = url ;
79
+ img . src = base64Svg ;
78
80
} ) ;
79
81
80
82
// temporary for backward compatibility
You can’t perform that action at this time.
0 commit comments