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

Camera image not saved #437

Open
vernazza opened this issue Feb 20, 2023 · 2 comments
Open

Camera image not saved #437

vernazza opened this issue Feb 20, 2023 · 2 comments

Comments

@vernazza
Copy link

vernazza commented Feb 20, 2023

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
@luismarquesnearsea
Copy link

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")

@sinhpn92
Copy link

sinhpn92 commented Mar 9, 2023

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.

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

3 participants