ivpusic / react-native-image-crop-picker

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

Selecting image giving different results on ANDROID #2071

Open NguyenHoangMinhkkkk opened 4 months ago

NguyenHoangMinhkkkk commented 4 months ago

Version

Tell us which versions you are using:

"react-native-image-crop-picker": "^0.41.2" "react-native": "0.68.7"

Platform

Tell us to which platform this issue is related

✅ IOS: Everything working good

❎ Android: Real device: Google Pixel 3a

Expected behaviour

How to get the path of a image picked ? and to know is it the image picked already or not. and for identifying the image

Actual behaviour

On Android, when i run the code below for select images from library. The paths are able to rendering by But... everytime i select the same image. Result give different path, no filename, different modificationDate

======== Same file but different data { "modificationDate": "1720336345004", "size": 429858, "mime": "image/jpeg", "height": 1080, "width": 810, "path": "file:///storage/emulated/0/Android/data/com.packagename/files/Pictures/74b401ba-28ee-41e3-bb37-3f6c7352b831.jpg" }

======== Same file but different data { "modificationDate": "1720336351601", "size": 429858, "mime": "image/jpeg", "height": 1080, "width": 810, "path": "file:///storage/emulated/0/Android/data/com.packagename/files/Pictures/b29cc714-16c5-41ed-8efa-a5c87c142d3e.jpg" }

Steps to reproduce

const result: Image[] = await ImageCropPicker.openPicker({
  mediaType: 'photo',
  compressImageMaxHeight: 1080,
  compressImageMaxWidth: 1080,
  loadingLabelText: "some-string",
  maxFiles: 20,
  multiple: true
});
console.log("result", result)

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