You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Kiran Sai (JIRA)" <ji...@apache.org> on 2012/11/08 20:32:12 UTC

[jira] [Created] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Kiran Sai created CB-1826:
-----------------------------

             Summary: correctOrientation when set to true crashes the app when loading Image
                 Key: CB-1826
                 URL: https://issues.apache.org/jira/browse/CB-1826
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 2.2.0
         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
            Reporter: Kiran Sai
            Assignee: Joe Bowser


set the flag correctOrientation to true. 
take a portrait high resolution image
application crashes with OutofMemory error

I see the issue fixed with CB-999 but I see the same problem on 2.2.0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Kiran Sai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kiran Sai updated CB-1826:
--------------------------

    Description: 
set the flag correctOrientation to true. 
take a portrait high resolution image
application crashes with OutofMemory error

Same happens when you load an image from gallery.

I see the issue fixed with CB-999 but I see the same problem on 2.2.0


=======================
	function galleryNoIssue(source) {
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
        destinationType: destinationType.FILE_URI,
        sourceType: source });
    }

    function galleryIssue(source) {
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
        destinationType: destinationType.FILE_URI,
        sourceType: source,
		correctOrientation : true });
    }

===========================

  was:
set the flag correctOrientation to true. 
take a portrait high resolution image
application crashes with OutofMemory error

Same happens when you load an image from gallery.

I see the issue fixed with CB-999 but I see the same problem on 2.2.0

    
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493632#comment-13493632 ] 

Joe Bowser commented on CB-1826:
--------------------------------

Not able to reproduce on the Galaxy Neuxs, Samsung Galaxy S2, or the HTC One X.  Is there anything else you're doing? 
                
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494255#comment-13494255 ] 

Joe Bowser commented on CB-1826:
--------------------------------

Yeah, I can reproduce this.  I don't think we can fix this, since this is an OOM error.  Are you sending this to a server?  If so, I'd recommend doing the heavy lifting there instead of the app.
                
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>         Attachments: LordGanesha.jpg, TestApp.apk
>
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-1826.
----------------------------

    Resolution: Won't Fix

This is more like "Can't Fix".  Image manipulation should be moved off the device to somewhere else due to memory issues and the inability of Android to handle these images well with their Java API.
                
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>         Attachments: LordGanesha.jpg, TestApp.apk
>
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Kiran Sai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kiran Sai updated CB-1826:
--------------------------

    Description: 
set the flag correctOrientation to true. 
take a portrait high resolution image
application crashes with OutofMemory error

Same happens when you load an image from gallery.

I see the issue fixed with CB-999 but I see the same problem on 2.2.0

  was:
set the flag correctOrientation to true. 
take a portrait high resolution image
application crashes with OutofMemory error

I see the issue fixed with CB-999 but I see the same problem on 2.2.0

    
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494027#comment-13494027 ] 

Simon MacDonald commented on CB-1826:
-------------------------------------

This is purely an issue with the crappy way Android handles Bitmap manipulation. Having to load an 8MP image file into memory in order to do the rotation results in a 50 megabyte allocation of memory which is usually causes and OutOfMemoryException. There is not going to be any quick silver bullet fix for this issue.
                
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>         Attachments: LordGanesha.jpg, TestApp.apk
>
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Kiran Sai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493684#comment-13493684 ] 

Kiran Sai commented on CB-1826:
-------------------------------

No Just that. Please take a picture with resolution of 8MB. Full code below,

=========================================================
<!DOCTYPE html>
<html>
  <head>
    <title>Capture Photo</title>

    <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
    <script type="text/javascript" charset="utf-8">

    var pictureSource;   // picture source
    var destinationType; // sets the format of returned value 

    document.addEventListener("deviceready",onDeviceReady,false);

    function onDeviceReady() {
        pictureSource=navigator.camera.PictureSourceType;
        destinationType=navigator.camera.DestinationType;
    }

    function onFail(message) {
      alert('Failed because: ' + message);
    }
  	
 	function onPhotoURISuccess(imageURI) {
      var largeImage = document.getElementById('largeImage');
      largeImage.style.display = 'block';
      largeImage.src = imageURI;

    }

	function galleryNoIssue(source) {
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
        destinationType: destinationType.FILE_URI,
        sourceType: source });
    }

    function galleryIssue(source) {
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
        destinationType: destinationType.FILE_URI,
        sourceType: source,
		correctOrientation : true });
    }

    </script>
  </head>
  <body>
	
    <button onclick="galleryIssue(pictureSource.PHOTOLIBRARY);">Gallery Issue</button><br>
    <button onclick="galleryNoIssue(pictureSource.PHOTOLIBRARY);">Gallery No Issue</button><br>
    <img style="display:none;" id="largeImage" src="" />
    
  </body>
</html>
===============================================================
                
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1826) correctOrientation when set to true crashes the app when loading Image

Posted by "Kiran Sai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494905#comment-13494905 ] 

Kiran Sai commented on CB-1826:
-------------------------------

Thanks Joe.


                
> correctOrientation when set to true crashes the app when loading Image
> ----------------------------------------------------------------------
>
>                 Key: CB-1826
>                 URL: https://issues.apache.org/jira/browse/CB-1826
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Andriod 4.0.3 on Samsung s3, app built on phonegap 2.2.0
>            Reporter: Kiran Sai
>            Assignee: Joe Bowser
>              Labels: Andriod, correctOrientation, crash, phonegap
>         Attachments: LordGanesha.jpg, TestApp.apk
>
>
> set the flag correctOrientation to true. 
> take a portrait high resolution image
> application crashes with OutofMemory error
> Same happens when you load an image from gallery.
> I see the issue fixed with CB-999 but I see the same problem on 2.2.0
> =======================
> 	function galleryNoIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source });
>     }
>     function galleryIssue(source) {
>       navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
>         destinationType: destinationType.FILE_URI,
>         sourceType: source,
> 		correctOrientation : true });
>     }
> ===========================

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira