Skip to content

Instantly share code, notes, and snippets.

@exinferis
Created December 5, 2012 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exinferis/4216618 to your computer and use it in GitHub Desktop.
Save exinferis/4216618 to your computer and use it in GitHub Desktop.
Convert Data URI to JS blob
dataURItoBlob: (dataURI) =>
binary = atob(dataURI.split(",")[1])
array = []
i = 0
while i < binary.length
array.push binary.charCodeAt(i)
i++
return new Blob( [new Uint8Array(array)],
type: "image/jpeg"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment