Android Camera Image quality dropping down


#1

I am developing an app for android devices. This app requires android Native camera app to launch and capture HD images. The images captured should not lose its quality and I am ok with the size of the images if its in MB’s…

Currently Im passing this object as camera options…

var options = {
			quality : 100,
  			destinationType : Camera.DestinationType.FILE_URI,
  			sourceType : Camera.PictureSourceType.CAMERA,
 			encodingType: Camera.EncodingType.JPEG,
    		targetWidth: 3000,
  			targetHeight: 3400,
  			popoverOptions: CameraPopoverOptions,
  			saveToPhotoAlbum: false
		};
		$cordovaCamera.getPicture().then(
			function(imageURI){
				console.log(imageURI);
				$state.go('singleFileUpload',{'uploadType':'1','uploadPath':imageURI});
			},
			function(err){
				$ionicLoading.show({ template: 'Picture was not taken!', noBackdrop: true, duration: 2000 });
			}
		);

What options should I change to get my requirement done?
OR, should I change the CameraLauncher.java to take only uncompressed lossless images?

Please help me with this problem.

Thanks!


#2

Try PNG that’s a lossless format instead of JPEG.


#3

I tried the PNG encoding type.

The cordova documentation says -
Android Quirks - EncodingType not supported in Android!

Is there any other way? :disappointed:


#4

Which documentation? Not this one: https://github.com/apache/cordova-plugin-camera#android-quirks

Just tried and it seems to work.


#5

Got it. Thanks. :smile: