Skip to content

Selection.getImage() crash on android when using maxWidth #126

@AlanChauchet

Description

@AlanChauchet

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Which platform(s) does your issue occur on?

  • Android
  • Android 7.0
  • Samsung Galaxy S7 Edge

Please, provide the following version numbers that yourissue occurs with:

  • CLI: 3.2.1
  • Cross-platform modules: 3.2.0
  • Runtime(s): 3.1.1
  • Plugin(s): tested with 3.0.6 / 4.0.0

Please, tell us how to recreate the issue in as much detail as possible.

When opening the image picker and selecting a single picture (with mode = 'simple'), if I call the function getImage with an option set to for example { maxWidth: 500 } /or any other value/ then the imagePicker show a black screen and never goes back to the app. If I dont set any option while using getImage, everything works fine

Is there any code involved?

permissions.requestPermission([
   'android.permission.READ_EXTERNAL_STORAGE',
   'android.permission.WRITE_EXTERNAL_STORAGE',
   'android.permission.CAMERA',
   'android.permission.RECORD_AUDIO',
])
   .then(() => {
       const context = imagepickerModule.create({
           mode: multiple ? 'multiple' : 'single',
           doneText: this.translateService.translateInstant('COMMONS.CONFIRM'),
           cancelText: this.translateService.translateInstant('COMMONS.CANCEL'),
           newestFirst: true
       });
       return context.authorize()
           .then(() => context.present())
           .then((selections) => {
               const selection = selections[0] || null;
               if (selection) {
                   selection.getImage({ maxWidth: 500 })
                       .then(imgSrc => ... )
               }
           })
   });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions