You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ralph S Theart (JIRA)" <ji...@apache.org> on 2014/02/28 18:06:21 UTC

[jira] [Created] (CB-6135) Camera api takes long time to return uri when using Camera.DestinationType.FILE_URI

Ralph S Theart created CB-6135:
----------------------------------

             Summary: Camera api takes long time to return uri when using Camera.DestinationType.FILE_URI
                 Key: CB-6135
                 URL: https://issues.apache.org/jira/browse/CB-6135
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
    Affects Versions: 3.3.0
            Reporter: Ralph S Theart


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);
	},




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)