You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2014/03/03 23:25:21 UTC

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

     [ https://issues.apache.org/jira/browse/CB-6135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-6135:
---------------------------------

    Component/s:     (was: iOS)
                 Plugin Camera

> 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: Plugin Camera
>    Affects Versions: 3.3.0
>            Reporter: Ralph S Theart
>              Labels: camera, ios
>
> 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.2#6252)