Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin crashes when using PHOTOLIBRARY on Android #548

Closed
3 tasks done
jfoclpf opened this issue Jan 16, 2020 · 1 comment · Fixed by #585
Closed
3 tasks done

Plugin crashes when using PHOTOLIBRARY on Android #548

jfoclpf opened this issue Jan 16, 2020 · 1 comment · Fixed by #585

Comments

@jfoclpf
Copy link

jfoclpf commented Jan 16, 2020

Bug Report

Problem

When obtaining some pictures on the phone file system using PHOTOLIBRARY, particularly image files stored in /Phone/Download, the app crashes. Normally it does work, but it seems in some folders the app crashes

What is expected to happen?

The function camera.getPicture(successCallback, errorCallback, options) should run the function successCallback

What does actually happen?

When the function camera.getPicture(successCallback, errorCallback, options) is called, wherein options has sourceType:Camera.PictureSourceType.PHOTOLIBRARY, the app crashes when I select certain files

Information

Command or Code

    var options = {
      quality: 50,
      destinationType: Camera.DestinationType.FILE_URI,
      sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
      encodingType: Camera.EncodingType.JPEG,
      mediaType: Camera.MediaType.PICTURE,
      allowEdit: false,
      correctOrientation: true // Corrects Android orientation quirks
    }

    console.log('starting navigator.camera.getPicture') // this is shown
    navigator.camera.getPicture(function (result) {
      console.log('cameraSuccess init') // this is never shown, it crashes before
      cameraSuccess(result)
    },
    function cameraError (error) {
      console.debug('error getting photo: ' + error, 'app') // this is not shown either, the app just crashes
    }, options)

Screenshots

drawing

drawing

Environment, Platform, Device

Ubuntu, Android, Samsung Galaxy A5

Version information

Cordova: 9.0.0 (cordova-lib@9.0.1)

Plugins

cordova-pdf-generator 2.0.8 "PDFGenerator"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-email-composer 0.8.15 "EmailComposer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-mobile-ocr 3.1.1 "Textocr"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-screen-orientation 3.0.2 "Screen Orientation"
cordova-plugin-simple-image-resizer 0.1.1 "Image Resizer"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
es6-promise-plugin 4.2.2 "Promise"
info.protonet.imageresizer 0.1.1 "Image Resizer"

Java

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

adb

Android Debug Bridge version 1.0.41
Version 29.0.1-5644136
Installed as /usr/local/android-sdk/platform-tools/adb

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@jfoclpf
Copy link
Author

jfoclpf commented Jan 20, 2020

What is very strange is that, when I get exactly the same picture but obtained through folder "Recent" in Android file Explorer opened by this plugin, the app does not crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants