NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
84 stars 63 forks source link

Remove line breaks when returning base64 string #61

Closed daltonpearson closed 5 years ago

daltonpearson commented 5 years ago

Description

On android the base64 string was being returned with line breaks in the string, angular will mark the URL as unsafe if it contains line breaks and it won't be displayed. So I've updated the option to return the base64 string without line breaks.

Type of change

How Has This Been Tested?

I made the changes to the source and ran the plugin in an ionic-native v4 app using angular and verified that the strings were being returned without line breaks.

Notes

I spent a lot of time debugging why the URLs were being marked as unsafe and wanted to save others from having to debug this. On iOS the URLs are returned without line breaks so this change also makes the behavior consistent between platforms.

ChrisTomAlx commented 5 years ago

Thanks a lot for this fix. I will test it on my end, approve and release a version to npm soon.

Cheers and have a nice day :) Chris Neutrinos

ChrisTomAlx commented 5 years ago

Works great! Thanks for your contribution!

Cheers and have a nice day :) Chris Neutrinos

daltonpearson commented 5 years ago

No problem thanks for the quick response. I also opened a PR in the ionic native repo to add base64 and quality options so they will be available whenever the patch goes out.

ChrisTomAlx commented 5 years ago

No problem thanks for the quick response. I also opened a PR in the ionic native repo to add base64 and quality options so they will be available whenever the patch goes out.

Absolutely love it!!!