Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:15:50+00:00 2026-06-13T17:15:50+00:00

I am using jQuery Mobile and PhoneGap to create an app that allows users

  • 0

I am using jQuery Mobile and PhoneGap to create an app that allows users to take a picture, view it on screen, and then upload it to a server application that will ultimately post it on a website.

This works well if I take the photo in Landscape mode, but crashes the application when I take a Portrait photo. As you can see from the code snippet below I am using the correctOrientation parameter to attempt to orient the photo after it is taken. Without this parameter the application doesn’t crash, however the photo is in the wrong orientation when it gets displayed.

Right now I’m testing this on Sony XPERIA android phone.

Here is the code responsible for the work.

function onPhotoFail(message) {
    alert('Failed because: ' + message);
}

function onPhotoSuccess(imageURI) {             
    var $image = $("img#upload-image");
$image.attr("src", imageURI);
}

function capturePhoto() {
navigator.camera.getPicture(onPhotoSuccess, onPhotoFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI , correctOrientation: true });     
}

Here’s the stack trace:

E/AndroidRuntime(31760): FATAL EXCEPTION: main
E/AndroidRuntime(31760): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
E/AndroidRuntime(31760):        at android.graphics.Bitmap.nativeCreate(Native Method)
E/AndroidRuntime(31760):        at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
E/AndroidRuntime(31760):        at android.graphics.Bitmap.createBitmap(Bitmap.java:444)
E/AndroidRuntime(31760):        at org.apache.cordova.CameraLauncher.getRotatedBitmap(CameraLauncher.java:483)
E/AndroidRuntime(31760):        at org.apache.cordova.CameraLauncher.onActivityResult(CameraLauncher.java:326)
E/AndroidRuntime(31760):        at org.apache.cordova.DroidGap.onActivityResult(DroidGap.java:823)
E/AndroidRuntime(31760):        at android.app.Activity.dispatchActivityResult(Activity.java:3908)
E/AndroidRuntime(31760):        at android.app.ActivityThread.deliverResults(ActivityThread.java:2549)
E/AndroidRuntime(31760):        at android.app.ActivityThread.handleSendResult(ActivityThread.java:2595)
E/AndroidRuntime(31760):        at android.app.ActivityThread.access$2000(ActivityThread.java:121)
E/AndroidRuntime(31760):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:973)
E/AndroidRuntime(31760):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(31760):        at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(31760):        at android.app.ActivityThread.main(ActivityThread.java:3701)
E/AndroidRuntime(31760):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(31760):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(31760):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/AndroidRuntime(31760):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
E/AndroidRuntime(31760):        at dalvik.system.NativeStart.main(Native Method)

I’ve done some searching around, and I don’t see anybody having this exact problem. Any help is appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:15:53+00:00Added an answer on June 13, 2026 at 5:15 pm

    I would have to see your stack trace to be sure but it is probably an OutOfMemoryException. Android handles image manipulation very badly. It basically needs to load the entire image into memory where each pixel is 4 bytes, that means up to 40 megabytes for a lot of modern phone cameras.

    My only suggestion right now is to try to switch the quality to 100. I know it sounds counter-intuitive but it make keep there from being as much processing in the background.

    You can read my blog post talking about some of the problems with the Camera:

    http://simonmacdonald.blogspot.ca/2012/07/change-to-camera-code-in-phonegap-190.html

    Also, if I can see the stack trace it would help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Jquery Mobile to create a mobile app in combination with phonegap. Now
I am creating an app using jQuery Mobile and PhoneGap. I delegate a button
I have a PhoneGap App using jQuery Mobile. At a certain page, I cannot
I have some strange scrolling problems with my PhoneGap (using jQuery Mobile) app: I'm
I have a Phonegap App, using jQuery and jQuery Mobile. In some page I've
I'm using Phonegap and Jquery Mobile on an Android app. I need to save
I'm making an PhoneGap app using Jquery Mobile, but I have a little problem
I'm making an app on PhoneGap using Jquery Mobile. The app runs fine on
In my PhoneGap/jQuery Mobile app, I'm currently using PhoneGaps' Camera API to allow the
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.