You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/12/06 05:53:41 UTC

[GitHub] [cordova-plugin-camera] iMestav edited a comment on issue #504: after auto back when take picture

iMestav edited a comment on issue #504:  after auto back when take picture
URL: https://github.com/apache/cordova-plugin-camera/issues/504#issuecomment-562442563
 
 
   Hi, I have this problem. 
   
   You can see on this video : https://streamable.com/xz6xm 
    
   This is my code : 
   
   `openCamera(who) {
               const app = this.$f7;
               const vm = this;
               this.signatureImg = '';
               this.deliveryPerson = who;
               this.reason = this.deliveryPerson;
               navigator.camera.getPicture(function(imageURI) {
                   app.dialog.preloader();
                   var options = new FileUploadOptions();
                   options.fileKey = "file";
                   options.fileName = imageURI;
                   options.mimeType = "image/jpeg";
                   options.chunkedMode = false;
                   var ft = new FileTransfer();
                   vm.componentKey += 1;
                   ft.upload(imageURI, 
                       encodeURI(localStorage.getItem('baseURL') + "upload-image?token=" + JSON.parse(localStorage.getItem('token'))), 
                       function(r) {
                           var data = JSON.parse(r.response);
                           vm.image = data.image;
                           app.dialog.close();
                           // vm.imagePopup = true;
                           vm.reciverHandle(vm.reason, vm.deliveryPerson, 'complete');
                           vm.updateComponent()
                           // vm.setStatus(null, vm.reason, null, data.image);
                       }, function(error) {
                           console.log(error)
                           app.dialog.alert('There is an error. Error Code : ' + error.code, 'Error');
                       }, options);
               }, function(error) {
                   console.log(error)
                   app.dialog.close();
                   // app.dialog.alert('Please try again later', 'Error');
               }, {
                   quality: 50, 
                   destinationType: navigator.camera.DestinationType.FILE_URI,
                   sourceType: navigator.camera.PictureSourceType.CAMERA,
                   correctOrientation : true,
                   cameraDirection : navigator.camera.Direction.BACK
               });
           },`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org