You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Joe Bowser (Commented) (JIRA)" <ji...@apache.org> on 2012/02/04 01:41:53 UTC

[jira] [Commented] (CB-220) OutOfMemory errors using Camera API on Android Nexus S

    [ https://issues.apache.org/jira/browse/CB-220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200206#comment-13200206 ] 

Joe Bowser commented on CB-220:
-------------------------------

I managed to recreate the bug, but this is unfortunately a known issue.  Here's the background on it:

A 5MP image is far too large to be passed through an intent in most cases. Even then, since all manipulations require making copies of this image in memory, making it worse, this will almost always cause the DATA_URL method to fail. A work-around is to use FILE_URL:

{navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 90, destinationType: Camera.DestinationType.FILE_URI, sourceType : Camera.PictureSourceType.CAMERA });}

This will work on the Nexus S, and is what we have included in the sample.



                
> OutOfMemory errors using Camera API on Android Nexus S
> ------------------------------------------------------
>
>                 Key: CB-220
>                 URL: https://issues.apache.org/jira/browse/CB-220
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.2.0
>         Environment: Android Nexus S
>            Reporter: Pamela Fox
>            Assignee: Joe Bowser
>
> I use the Camera API to let users take photos from the PhoneGap app.
> I first experienced the error reported in https://issues.apache.org/jira/browse/CB-14 but after applying the patch, I no longer experienced the error. However, I still experienced two other OutOfMemory errors:
> "bitmap size exceeds VM budget" (full trace: http://pastebin.com/raw.php?i=0SsTgbvF)
> And one during com.phonegap.api.PluginResult.toSuccessCallbackString (full trace: http://pastebin.com/raw.php?i=3cgyR5Dk)
> I seem to avoid these errors by requesting a low quality (20) and low width/height (400/400)..but I imagine that workaround won't work for all people using the Camera API, and I don't feel great on relying on that as a solution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira