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

Gallery shows blank spaces #235

Open
Davide153 opened this issue Dec 1, 2020 · 0 comments
Open

Gallery shows blank spaces #235

Davide153 opened this issue Dec 1, 2020 · 0 comments

Comments

@Davide153
Copy link

Davide153 commented Dec 1, 2020

Hi,
I'm having an issue with imagePicker for quite a while now.

I have a function that opens the device's camera to take a picture. Every time I go out of that function without taking any photo, a reference is saved as a blank image in the imagePicker gallery.
I tried deleting the app's cache or the temp directory but nothing...the blank spaces go away only if I restart/turn off the phone.

This is my function to take photos using media-capture plugin:

  takePhoto() {
    this.mediaCapture.captureImage().then(
      (data: MediaFile[]) => {
        if (data.length > 0) {
          this.moveFileToLocalDir(data[0].fullPath);
        }
      },
      (err: CaptureError) => {
        console.error(err)
      }
    );
  }

And this is the imagePicker function to choose multiple images from gallery:

  selectPhoto() {
    const options: ImagePickerOptions = {
      maximumImagesCount: 5
    };
    this.imagePicker.getPictures(options).then(
      results => {
        for (var i = 0; i < results.length; i++) {
          this.moveFileToLocalDir(results[i]);
        }
      },
      (err: CaptureError) => console.error(err)
    );
  }

After inspecting what happens I saw that the takePhoto() function enters the device's Pictures folder and then leaves right after without selecting anything.

I searched for something to update the app's gallery or ways to delete the reference but couldn't find anything.

What would you recommend me to do?

Thanks!

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

No branches or pull requests

1 participant