android-image-picker icon indicating copy to clipboard operation
android-image-picker copied to clipboard

Camera image not saved

Open vernazza opened this issue 2 years ago • 2 comments

Expected Behavior

Captured image exists

Actual Behavior

Captured image doesn't exist

Steps to Reproduce the Problem

  1. Create a launcher
 launcher = registerImagePicker { result ->
            if (result.isNotEmpty()) {
                val exists = File(result.first().path).exists()
            }
}

  1. Call the launcher launcher.launch(CameraOnlyConfig())

The file returned as result doesn't exist. In Logcat I find:

MediaScannerConnection  D  Scanned /storage/emulated/0/Android/data/packagename/files/Pictures/Camera/IMG_20230220_184510_996.jpg to null
ImagePicker             D  File /storage/emulated/0/Android/data/packagename/files/Pictures/Camera/IMG_20230220_184510_996.jpg was scanned successfully: null
ImagePicker             D  scanFile is failed. Uri is null

Specifications

  • Image Picker Version: 3.0.0
  • Android OS: Android 12
  • Phone: Samsung S22

vernazza avatar Feb 20 '23 17:02 vernazza

My friend, I found a workaround but is not the best solution. Just replace the path manually with this var finalPath = if (File(image.path).exists()) image.path else image.path.replaceBefore("/I", "/storage/emulated/0/Pictures")

luismarquesnearsea avatar Mar 03 '23 12:03 luismarquesnearsea

I have same issue. The image always saved on /storage/emulated/0/Pictures folder. The option savePath is not working. It's still return in the result but it's doesn't saved.

It's seem to be a bug.

sinhpn92 avatar Mar 09 '23 03:03 sinhpn92