File tree 1 file changed +22
-5
lines changed
1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 106
106
} )
107
107
}
108
108
} else if ( CanvasPrototype . toDataURL && dataURLtoBlob ) {
109
- CanvasPrototype . toBlob = function ( callback , type , quality ) {
110
- var self = this
111
- setTimeout ( function ( ) {
112
- callback ( dataURLtoBlob ( self . toDataURL ( type , quality ) ) )
113
- } )
109
+ if ( CanvasPrototype . msToBlob ) {
110
+ CanvasPrototype . toBlob = function ( callback , type , quality ) {
111
+ var self = this
112
+ setTimeout ( function ( ) {
113
+ if (
114
+ ( ( type && type !== 'image/png' ) || quality ) &&
115
+ CanvasPrototype . toDataURL &&
116
+ dataURLtoBlob
117
+ ) {
118
+ callback ( dataURLtoBlob ( self . toDataURL ( type , quality ) ) )
119
+ } else {
120
+ callback ( self . msToBlob ( type ) )
121
+ }
122
+ } )
123
+ }
124
+ } else {
125
+ CanvasPrototype . toBlob = function ( callback , type , quality ) {
126
+ var self = this
127
+ setTimeout ( function ( ) {
128
+ callback ( dataURLtoBlob ( self . toDataURL ( type , quality ) ) )
129
+ } )
130
+ }
114
131
}
115
132
}
116
133
}
You can’t perform that action at this time.
0 commit comments