You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/20 16:50:57 UTC

[GitHub] [cordova-plugin-camera] breautek commented on issue #528: Android : THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 24ms. Plugin should use CordovaInterface.getThreadPool

breautek commented on issue #528: Android : THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 24ms. Plugin should use CordovaInterface.getThreadPool
URL: https://github.com/apache/cordova-plugin-camera/issues/528#issuecomment-556095740
 
 
   > W/PluginManager: THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 24ms. Plugin should use CordovaInterface.getThreadPool().
   
   This is just a warning stating that the main thread was blocked for 24ms (which meant UI frames were to be dropped). This has no relation to your reported behaviour, especially since it was only blocked for 24ms.
   
   > Result was:"/9j/4AAQSkZJRgABAQAAAQABAAD/2w
   
   This suggests that the data is actually being sent to the JS.
   
   Note that when using the `DATA_URL` this could take a  long time (and consumes a lot of memory) because the binary data is represented in a base64 encoded string, which will be approximately 40% larger than the actual binary data.
   
   Modern phones today captures these images in a very large resolution. See the note in the [docs](https://github.com/apache/cordova-plugin-camera#cameragetpicturesuccesscallback-errorcallback-options)...
   
   >NOTE: Photo resolution on newer devices is quite good. Photos selected from the device's gallery are not downscaled to a lower quality, even if a quality parameter is specified. To avoid common memory problems, set Camera.destinationType to FILE_URI rather than DATA_URL.
   
   On modern phones it is a better approach to use a FILE_URI destination instead, then read the file into a blob, which has the capability of creating blob urls without having a base64 encoded image in the javascript memory. Blob urls can be used similar to data urls, such as inside the src attribute of an img tag.
   
   This keeps handling of the binary data outside of the javascript environment, freeing up its only thread and keep the javascript memory space low.
   
   This is likely related or duplicate of https://github.com/apache/cordova-plugin-camera/issues/499

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org