[ 
https://issues.apache.org/jira/browse/CB-910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon MacDonald resolved CB-910.
--------------------------------

    Resolution: Fixed

I've added some code in order to reduce the likelihood of this problem 
occurring. The root cause of the issue is that in order to compress the JPEG 
file to a different quality level Android requires the entire image be loaded 
in memory. The size of the image in memory is width x height x 4 in bytes. So 
for recent cameras the image can take upwards of 20 mb of memory. 

With my fix you need to specify a quality of 100 so the image is not 
compressed. Any other value will cause the image to be compressed which leads 
to the issue.

In order to fix the compression problem I'm going to open another ticket where 
we will need to write our own jpg compression algorithm.
                
> Consecutive photographs with the camera of the Asus Transformer pad causes 
> java.lang.OutOfMemoryError
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CB-910
>                 URL: https://issues.apache.org/jira/browse/CB-910
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.7.0, 1.8.0
>         Environment: Android 4.0.3, PhoneGap 1.8.0 OR PhoneGap 1.7.0, Asus 
> Transformer Pad
> (if I run the same code, or any other using camera in iPad2, Samsung Galaxy 
> 2, no problems)
>            Reporter: Susanna Huhtanen
>            Assignee: Simon MacDonald
>            Priority: Minor
>              Labels: features
>             Fix For: 1.9.0
>
>
> 1. Expected outcome:
> I can take consecutive photographs with the camera of the device.
> 2. The actual outcome:
> After a few pictures has been taken the application crashes.
> 3.
> Wrap the index.html in Android 4.0.3, launch the app on the Asus Transformer, 
> take pictures, anything from 2-5 pictures makes the app to crash. If you 
> alter the code and create a local storage where to store the url and some 
> text, the second picture is always enough to crash the app with the same 
> crash report.
> index.html and logcat
> https://gist.github.com/2922651

--
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

        

Reply via email to