1

I have a Phonegap application that uses the camera Cordova API to take a picture and upload it to my server upon successful capture. The only problem is that the quality of the image is too good. It will really be a problem when I reach a higher user count.

Here is my javascript:

function capture() {
    navigator.camera.getPicture(cameraSuccess, cameraError, { 
        quality: 5, 
        destinationType: destinationType.FILE_URI,
        sourceType : sourceType.CAMERA,
        encodingType: encodingType.JPEG,
        targetWidth: 300
    });
}

The file being uploaded is about 240KB in size and more then 1200 pixels wide.

I tried adding the "quality" and "targetWidth" within the options to change the quality of the image, but to no avail.

Any help would be appreciated, thanks!

Karl
  • 595
  • 1
  • 10
  • 31

2 Answers2

0

So I took @Gerben advice and I used html5 canvas to modify my image before using javascript (jQuery) to post it to the server.

Here is the link.

Community
  • 1
  • 1
Karl
  • 595
  • 1
  • 10
  • 31
0

Utilizing a service like Amazon Web Services (AWS)S3 and the corresponding API, you could store your images elsewhere once they get to your server, and simply store the resulting links to the uploaded pictures. You still will eventually run into space issues, but expanding should be trivial. To start however, you can get a free trial account.

This way you get blazin hi def pics for display, and the hosting server for your site won't get bogged down.

Softy Devel
  • 81
  • 3
  • 8