Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6135

Camera api takes long time to return uri when using Camera.DestinationType.FILE_URI

    XMLWordPrintableJSON

Details

    Description

      For some reason there is a slight pause(it's very noticeable, almost seems like app is about to crash) when choosing an image from the photo library when use FILE_URI...if I use NATIVE_URL when I choose a picture there is no such pause.

      Here is some code:

      captureImage: function(){

      var onPhotoFail = function(message)

      { //console.log(message); }

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

      var onPhotoConfirm = function(buttonIndex){

      destinationType = Camera.DestinationType.NATIVE_URI;

      switch(buttonIndex)

      { case 1: pictureSource= Camera.PictureSourceType.CAMERA; break; case 2: pictureSource= Camera.PictureSourceType.PHOTOLIBRARY; break; }

      if(buttonIndex == 1 || buttonIndex == 2){
      navigator.camera.getPicture(Messaging.createFileEntry, onPhotoFail,

      { destinationType: 1, sourceType: pictureSource, mediaType : Camera.MediaType.ALLMEDIA, /* encodingType: Camera.EncodingType.JPEG, */ allowEdit : false, saveToPhotoAlbum: false, quality: 50 }

      );
      }
      }
      urapp.notify.confirm('Image Capture','What would you like to do?',["Take Photo","Choose Existing", 'Cancel'],onPhotoConfirm);
      },

      Attachments

        Activity

          People

            Unassigned Unassigned
            drumaboy46 Ralph S Theart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: