Description
When calling MediaPicker.PickPhotosAsync( on an Andriod 9.0 device you are not able to call OpenReadAsync on the FileResult object. This results in an except getting the first result we are unable to
System.UnauthorizedAccessException: Access to the path '/storage/emulated/0/Download/IMG_6481.PNG' is denied.
I tried with a different image and I got the same result (for a different path).
Access to the path '/storage/emulated/0/Pictures/Bicho-preguiça_3.jpg' is denied.
There is also an odd issue here. If I am applying the below properties why is is it tyring to load the image from source instead of the one that should be saved into cache (as observed on other OS versions)
// Optional processing for images
MaximumWidth = 1024,
MaximumHeight = 768,
CompressionQuality = 85,
RotateImage = true,
PreserveMetaData = true,
I used this source image from Wikipedia just to confirm that a resize should happen.
EDIT: Not shown in this sample, take photo also fails but works on Android 10.0
Steps to Reproduce
- Run the SelectImageTest app
- Click the button to select an image from the gallery
- Either the size of the image in bytes will be written in the text below, or the exception message will be displayed.
Link to public reproduction project repository
https://github.com/beeradmoore/maui-MediaPickerAndroidCrash
Version with bug
10.0.51, 10.0.60
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 9 (but likely below)
Did you find any workaround?
Nope
Relevant log output
Description
When calling
MediaPicker.PickPhotosAsync(on an Andriod 9.0 device you are not able to callOpenReadAsyncon theFileResultobject. This results in an except getting the first result we are unable toI tried with a different image and I got the same result (for a different path).
There is also an odd issue here. If I am applying the below properties why is is it tyring to load the image from source instead of the one that should be saved into cache (as observed on other OS versions)
I used this source image from Wikipedia just to confirm that a resize should happen.
EDIT: Not shown in this sample, take photo also fails but works on Android 10.0
Steps to Reproduce
Link to public reproduction project repository
https://github.com/beeradmoore/maui-MediaPickerAndroidCrash
Version with bug
10.0.51, 10.0.60
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 9 (but likely below)
Did you find any workaround?
Nope
Relevant log output