-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas#toDataURL() returns image data url string with quotes included #124
Comments
Please can we document this as it isn't the same signature as what is on the web. Because of me just ignoring the quotes when I read them in the console, I didn't notice the extra quotes D: Took me a while to figure out that one. |
I'll accept a PR for a solution |
Calling this method gives an error. |
I feel desperate after figured out that's the reason why I can't save image |
the same problem |
hi, anything new for this issue? |
I just ran into this issue after spending a few hours debugging. I worked around it by replacing the quotes in the string returned:
I'm not sure what the best solution is here. Singling out the toDataURL call when choosing whether to stringify the response message in the code @rocwind linked above doesn't feel right. |
Has anybody found a solution to the |
This is so stupid. Already 4 years and this still isn't fixed. |
Canvas#toDataURL() returns a string like
"\"data:image/png;base64,iVB...\""
.It seems caused by the payload being
JSON.stringify()
at web view side: https://github.com/iddan/react-native-canvas/blob/master/src/webview.js#L88and get returned directly at React Native side:
https://github.com/iddan/react-native-canvas/blob/master/src/Canvas.js#L76
The text was updated successfully, but these errors were encountered: