cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

Application crash when take picture from camera and accept this image

Open marina31714 opened this issue 3 years ago • 4 comments

Bug Report

Problem

When I take a picture with the tablet and accept, the application crashes.

What is expected to happen?

The image is successfully added and the alert is displayed.

What does actually happen?

The application is crashed.

Information

When select image from gallery it working fine When change option to allowEdit to true, no crashes but showed this alert: You can't edit this image.

Command or Code

function setOptions(srcType) { var options = { // Some common settings are 20, 50, and 100 quality: 75, destinationType: Camera.DestinationType.FILE_URI, // In this app, dynamically set the picture source, Camera or photo gallery sourceType: srcType, encodingType: Camera.EncodingType.JPEG, mediaType: Camera.MediaType.PICTURE, allowEdit: false, correctOrientation: true } return options; }

                    var srcType = Camera.PictureSourceType.CAMERA;
                    var options = setOptions(srcType);

                    navigator.camera.getPicture(function cameraSuccess(imageUri) {

                        alert("get picture");

                    }, function cameraError(error) {
                        console.debug("Unable to obtain picture: " + error, "app");

                    }, options);

Environment, Platform, Device

Lenovo tab m10 hd Android: 11

Version information

Cordova 11.0.0 Cordova platform: Android 10.1.2 Cordova plugins: image

Android studio: 2021.1 Android sdk-tools: image Java Jdk: image Gradle: image

Operating System: Windows 10 Home

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

marina31714 avatar Sep 15 '22 10:09 marina31714

I have the same issue and tablet, have you solved it?

FZampetti avatar Sep 23 '22 13:09 FZampetti

Hi @FZampetti, I change the plugin. Now I use https://github.com/apache/cordova-plugin-media-capture. I hope this helps to you.

marina31714 avatar Sep 26 '22 09:09 marina31714

Presumably the same issue as #679

mac89 avatar Oct 07 '22 08:10 mac89