Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CordovaCamera always a Square photo?

What do I have to change so CordovaCamera doesn't make Square photos anymore?

Now when I call this code:

 var options = {
          quality: 100,
          destinationType: Camera.DestinationType.DATA_URL,
          sourceType: Camera.PictureSourceType.CAMERA,
          allowEdit: true,
          encodingType: Camera.EncodingType.JPEG,
          // targetWidth: 1600,
          // targetHeight: 1280,
          popoverOptions: CameraPopoverOptions,
          saveToPhotoAlbum: false,
          correctOrientation:true
        };

          $cordovaCamera.getPicture(options).then(function (imageData) {
              $scope.imgURI = "data:image/jpeg;base64," + imageData;

It opens the Camera, you take the photo, then you get a screen where you see a Square. When you say "use photo" it saves the picture part that was inside the square..

like image 244
user1469734 Avatar asked Dec 24 '22 09:12

user1469734


1 Answers

If you use allowEdit: true,, after taking the picture it goes to the crop screen, and the crop screen always crops a square.

If you don't want a square then use allowEdit: false, and you'll use the original image with the original size.

like image 107
jcesarmobile Avatar answered Dec 28 '22 07:12

jcesarmobile