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

Quality parameter does not affect pictures chosen from the gallery.

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.7.0
    • None
    • None

    Description

      Aram picchipalarm@googlemail.com via googlegroups.com

      HI,
      Im using phonegap online build for my html5 app
      currently testing on android 2.3.4

      the problem is when uploading a picture from camera capture the quality option works but when selecting from gallery it uploads full image size

      here are some code, for when button pressed.

      Example.js
      if (options[0]["selector"] == 1)
      { 
      	var myobj ={
      		quality: 2, 
      		destinationType: navigator.camera.DestinationType.DATA_URL ,
      		sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY 
      	}
      			
      }
      else if (options[0]["selector"] == 2)
      {
      	var myobj ={
      		quality: 2, 
      		destinationType: navigator.camera.DestinationType.FILE_URI,
      		sourceType: navigator.camera.PictureSourceType.CAMERA
      	}
      }
      			
      navigator.camera.getPicture(function (fileURI) {
      	var win = function(r) {
      	 	alert("win");
      	}
      					
      	var fail = function(error) {
      					
      		alert("An error has occurred: Code = " + error.code);
      	}
      	
      	var options = new FileUploadOptions();
      	options.fileKey="file";
      	options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
      	options.mimeType="text/plain";
      
      	var params = new Object();
      	params.xx= "xx";
      				
      	options.params = params;
      			
      	var ft = new FileTransfer();
      	ft.upload(fileURI, "http://xx.xx.com/service/", win, fail, options);
      
      			
      	},
      	function(message) {
      		alert('get picture failed'); 
      					
      	}, myobj);
      
      

      just to confirm button press correctly selects gallery or camera and both upload fine to my server, problem in quality of gallery item cant be changed?

      Simon said:
      Just wondering if we should fix this or update the docs to make it clear how quality works when selecting from the photo library. I will check with Becky to see how iOS handles as BB ignores quality.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            bowserj Joey Robert Bowser
            macdonst Simon MacDonald
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment