incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (Issue Comment Edited) (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (CB-220) OutOfMemory errors using Camera API on Android Nexus S
Date Sat, 04 Feb 2012 00:41:54 GMT

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

Joe Bowser edited comment on CB-220 at 2/4/12 12:40 AM:
--------------------------------------------------------

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:

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

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



                
      was (Author: bowserj):
    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

        

Mime
View raw message