w3c / FileAPI

File API
https://w3c.github.io/FileAPI/
Other
104 stars 44 forks source link

readAsDataURL should be more precise about the data URL contents #104

Open domenic opened 6 years ago

domenic commented 6 years ago

In particular, it appears all browsers base64-encode the contents; see https://github.com/jsdom/jsdom/issues/2269 for the original report.

Probably it'd be best to give the exact algorithm for creating the string from the contents of the type attribute and the bytes of the Blob.

annevk commented 6 years ago

See also https://github.com/whatwg/fetch/issues/665 which this would tie into (if someone wants to work on that, feel free, happy to assist).

inexorabletash commented 6 years ago

Re: "creating the string from the contents of the type attribute" - just a note in case someone tackles this. Beware of the gotcha associated with #43 - namely, as the spec is currently written, the value returned by the type attribute's getter and the internal type of the blob (which isn't clearly documented) differ if the type is not a parseable MIME type.