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/10/02 17:27:01 UTC

[GitHub] [cordova-plugin-camera] breautek commented on issue #499: Black screen when select an image from gallery

breautek commented on issue #499: Black screen when select an image from gallery
URL: https://github.com/apache/cordova-plugin-camera/issues/499#issuecomment-537597180
 
 
   > Mine is ios 12.4.1 on iPhone XR & iPhone X
   Thanks for this information. This was to try to determine if it is specific to an iOS 13 change as many issues that is propping lately are... In this case, it appears to be not.
   
   > The image file size was 2MB, there's no black screen when I reduce the file size to 170KB.
   
   This, with the combination of using `this.camera.DestinationType.DATA_URL` leads to believe the black screen you are seeing is caused by the javascript being busy encoding 2 megabytes of binary data (which will result in a very large string, as encoded base64 is about 40% larger than the actual binary data its representing).
   
   See the notice 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 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