breautek commented on issue #710:
URL: 
https://github.com/apache/cordova-plugin-camera/issues/710#issuecomment-780503858


   > I'm returning directly the base 64 encoded string and it is very intensive 
data.
   
   There is also nothing Cordova can do about Base64 encoded images. Modern 
phones can return a very large resolution for images, and these phones can also 
be paired with low memory resources. Base64 will blow up the size of any binary 
file by about ~30%. Additionally, it needs to copy that data from native to the 
webview. This results in high memory usage spikes. Strings in the JS 
environment are also pass-by-value, so they are furthered copied for every time 
you pass that string around in your application.
   
   Cordova makes note of this in the example:
   
   ```
   /**
    * Warning: Using DATA_URL is not recommended! The DATA_URL destination
    * type is very memory intensive, even with a low quality setting. Using it
    * can result in out of memory errors and application crashes. Use FILE_URI
    * instead.
    */
   ```
   
   Using `FILE_URI` destination is the most efficient ways to work with images.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to