ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.08k stars 1.55k forks source link

IOS can only select preselected photos #1613

Open Kiura opened 3 years ago

Kiura commented 3 years ago

Version

Tell us which versions you are using: 0.36.2

Platform

Tell us to which platform this issue is related

Expected behaviour

Access to all photos

Actual behaviour

Only able to access preselected photos on the first launch

Steps to reproduce

  1. ImagePicker.openPicker({ forceJpg: true, compressImageMaxWidth: 300, compressImageMaxHeight: 300, compressImageQuality: 0.8, width: 300, height: 300, cropping: true, mediaType: 'photo', })

  2. Try to select a photo

Attachments

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

Kiura commented 3 years ago

At least if there was an option to re-request the permission.

rzdev commented 3 years ago

@Kiura hi, have you find a workaround for this issue? facing the same issue too

Kiura commented 3 years ago

@rzdev, Hi, I used react-native-image-picker to pick the images on iOS and after the user selects the image I use this library to allow users to crop the image.

muccurly commented 3 years ago

I have same issue, Someone find answear ?

Seanmclem commented 3 years ago

@rzdev, Hi, I used react-native-image-picker to pick the images on iOS and after the user selects the image I use this library to allow users to crop the image.

How do you use this library to crop the image from the other library? I don't see the code that allows you to use other file sources within this library. What's your method?

Kiura commented 3 years ago

I use the library to pick the image using this method: launchImageLibrary, Then I user ImagePicker.openCropper to crop the image

launchImageLibrary({...},
  async data => {
    if (!data || !data.assets || data.assets.length === 0 && data.didCancel) return;
    const asset = data.assets[0];
    const path = asset.uri || '';
    // TODO: a hack to make the cropper work
    await sleep(500);
    const image = await ImagePicker.openCropper({
      path: path,
      ...
    });
  },
);
osamabinsaleem commented 3 years ago

Having the same issue

LucasClaude commented 2 years ago

I use the library to pick the image using this method: launchImageLibrary, Then I user ImagePicker.openCropper to crop the image

launchImageLibrary({...},
  async data => {
    if (!data || !data.assets || data.assets.length === 0 && data.didCancel) return;
    const asset = data.assets[0];
    const path = asset.uri || '';
    // TODO: a hack to make the cropper work
    await sleep(500);
    const image = await ImagePicker.openCropper({
      path: path,
      ...
    });
  },
);

Hey I just wanted to check in to see if you ever found a better solution to this, thanks!

Kiura commented 2 years ago

Hey I just wanted to check in to see if you ever found a better solution to this, thanks!

unfortunately no, still using the hack...