You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a quick look at this library’s dataUrlToBlob() implementation reveals however that it throws away all of the media type parameters! And blindly assumes base64 encoding.
Current implementation:
export function dataURLToBlob (dataURL: string): Blob {
var type = dataURL.match(/data:([^;]+)/)[1]
var base64 = dataURL.replace(/^[^,]+,/, '')
var buff = binaryStringToArrayBuffer(atob(base64))
return createBlob([buff], { type: type })
}
Issues:
A data url without ;base64 appended to the media type should just percent-decode the data.
The type should include its parameters; for example, in text/plain;charset=iso-8859-5 (used with or without the base64-encoding), dropping the charset parameter might result in problems when decoding the blob’s data.
The text was updated successfully, but these errors were encountered:
As remarked in #61:
Current implementation:
Issues:
A data url without
;base64
appended to the media type should just percent-decode the data.The type should include its parameters; for example, in
text/plain;charset=iso-8859-5
(used with or without the base64-encoding), dropping the charset parameter might result in problems when decoding the blob’s data.The text was updated successfully, but these errors were encountered: