Skip to content

Pictures taken with camera dissapears in api29 (multimode not working with camera) #280

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

Closed
per-johansson-74 opened this issue Jun 30, 2020 · 8 comments

Comments

@per-johansson-74
Copy link
Contributor

Expected Behavior

When taking a photo with the camera I expect to be able to select it (multi mode)

Actual Behavior

After taking a picure i get returned to the image selection part and the new image is not to be found (its not found in gallery either).

Steps to Reproduce the Problem

.showCamera(true)
.folderMode(true)
.imageDirectory("mydirectory")

if I add .returnMode(ReturnMode.CAMERA_ONLY) then i get the image and can use it, but its not in gallery and this is a workaround since it won't work when you want multiselect

I think it's because on older api it is saved in
/storage/emulated/0/Pictures/myfolder/IMG_20200630_114736_962.jpg

and with new api (tested with and without requestlegacystorage)
/storage/emulated/0/Android/data/se.mypackagename.xxxx.debug/files/Pictures/myfolder/IMG_20200630_140814_772.jpg

I suspect there is a missing call to index the file or something?

Specifications

  • Image Picker Version: 2.3.1
  • Android OS: api29 (Android 10)
  • Phone: Samsung Galaxy z-flip
@per-johansson-74
Copy link
Contributor Author

per-johansson-74 commented Jun 30, 2020

Another workaround is if you have WRITE_EXTERNAL_STORAGE permission
is to
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES + "/myfolder/");
path.mkdirs();
ImagePicker.create(this)
.showCamera(true)
.folderMode(true)
.imageFullDirectory(path.getAbsolutePath())

This will revert to old working (for now) way

@vajiralasantha
Copy link

Another workaround is if you have WRITE_EXTERNAL_STORAGE permission
is to
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES + "/myfolder/");
path.mkdirs();
ImagePicker.create(this)
.showCamera(true)
.folderMode(true)
.imageFullDirectory(path.getAbsolutePath())

This will revert to old working (for now) way

Fixed my issue. Any word on an official fix?

@rahul4452
Copy link

Another workaround is if you have WRITE_EXTERNAL_STORAGE permission
is to
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES + "/myfolder/");
path.mkdirs();
ImagePicker.create(this)
.showCamera(true)
.folderMode(true)
.imageFullDirectory(path.getAbsolutePath())

This will revert to old working (for now) way

Thanks for this workaround.

@hoajb
Copy link

hoajb commented Sep 15, 2020

Another workaround is if you have WRITE_EXTERNAL_STORAGE permission
is to
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES + "/myfolder/");
path.mkdirs();
ImagePicker.create(this)
.showCamera(true)
.folderMode(true)
.imageFullDirectory(path.getAbsolutePath())

This will revert to old working (for now) way

Thanks. It worked for me.

Image Picker Version: 2.3.2
Android OS: api29 (Android 10)
Phone: Samsung Galaxy A11

@hjchin
Copy link
Contributor

hjchin commented Sep 25, 2020

it does not work for me.

Based on the log,
File /storage/emulated/0/Android/data/xxx/files/Pictures/myfolder/IMG_20200925_163431_588.jpg was scanned successfully: null

the URI after scanning is null.

it works in API 27.

@hjchin
Copy link
Contributor

hjchin commented Sep 26, 2020

I have the code for Android Q, after watching and reading the docs, finally. I will raise a PR soon.

hjchin added a commit to hjchin/android-image-picker that referenced this issue Sep 26, 2020
use MediaStore to support Android Q
esafirm pushed a commit that referenced this issue Oct 3, 2020
use MediaStore to support Android Q
@esafirm
Copy link
Owner

esafirm commented Oct 3, 2020

Should be fixed in master please wait for next release

@esafirm esafirm closed this as completed Oct 3, 2020
@dfabreguette
Copy link

master branch does not fix the problem for use with Android Q devices (Huawei P30 pro for example).
Any chances the next realease will be ready soon ?

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

7 participants