Get rid of default parameter values in toBlob polyfill as toDataURL has the same defaults.
This commit is contained in:
parent
9b4bb001c3
commit
21849f79c8
@ -5,7 +5,7 @@ Polyfill =
|
|||||||
return
|
return
|
||||||
toBlob: ->
|
toBlob: ->
|
||||||
return if HTMLCanvasElement::toBlob
|
return if HTMLCanvasElement::toBlob
|
||||||
HTMLCanvasElement::toBlob = (cb, type='image/png', encoderOptions=null) ->
|
HTMLCanvasElement::toBlob = (cb, type, encoderOptions) ->
|
||||||
url = @toDataURL type, encoderOptions
|
url = @toDataURL type, encoderOptions
|
||||||
data = atob url[url.indexOf(',')+1..]
|
data = atob url[url.indexOf(',')+1..]
|
||||||
# DataUrl to Binary code from Aeosynth's 4chan X repo
|
# DataUrl to Binary code from Aeosynth's 4chan X repo
|
||||||
@ -13,5 +13,5 @@ Polyfill =
|
|||||||
ui8a = new Uint8Array l
|
ui8a = new Uint8Array l
|
||||||
for i in [0...l] by 1
|
for i in [0...l] by 1
|
||||||
ui8a[i] = data.charCodeAt i
|
ui8a[i] = data.charCodeAt i
|
||||||
cb new Blob [ui8a], {type}
|
cb new Blob [ui8a], {type: type or 'image/png'}
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user