VinceG/vue-web-cam

base64 is invalid

skuzzymiglet opened this issue · 3 comments

Running atob on capture returns an error DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

Sorry, I was taking everything incl the content type

@skuzzymiglet i just had this issue today, but couldn't remedy the situation.
I'm wondering what worked for you? I.e. How much of data:image/jpeg;base64,/9j/4AAQSk... did you slice?

I tried removing data:, image/jpeg; and base64, and combinations of them with no luck.

I realized that the returned value is actually a dataUri that happens to be base64 encoded. Once I knew that, I was able to convert to Blob.

Perhaps the READ.ME could be updated to:

Methods

name param notes
capture void Capture the current image through the webcam as base64 encoded dataUri