cordova-plugin-media-capture
cordova-plugin-media-capture copied to clipboard
Incorrect path returned for saved photo
Bug Report
Problem
Launch the camera to capture a photo; take the photo; examine the opject returned. The fullPath
property of the returned object is something like file:///storage/emulated/0/Pictures/1652174370741.jpg
, while the image file is actually saved to something like file:///storage/emulated/0/DCIM/Camera/IMG_20220510_101151.jpg
.
What is expected to happen?
The correct file path is returned for the newly-created file.
What does actually happen?
An incorrect file path is returned. Although the photo is saved to disk, there is no way to identify it from the information returned.
Information
The video capture works fine. The fullPath
property of the returned object is like file:///storage/emulated/0/DCIM/Camera/VID_20220510_101151.mp4
, and that's the actual path to the saved file.
At least one other person has mentioned a permissions problem causing problems with accessing the file from the information returned. I don't believe this is anything to do with permissions, given that the image file actually saves, and it works fine for video files.
(I can't try audio - I get a "No Activity found the handle Audio Capture" error.)
Environment, Platform, Device
Nokia 7.2 Android 11
Version information
Cordova Android 10.1.2 Media capture plugin versions 3.0.3 and 4.0.0-dev (I've not investigated video behaviour in 3.0.3). File plugin versions 6.0.2 (for 3.0.3) and 7.0.0 (for 4.0.0-dev) Awesome Cordova plugins wrapper version 5.39.1
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
I have the same problems as you, also the single MediaFile has a field named "localURL" which will be usefull but it is not accessible for some reason.
The Audio issue is also annoying.
I'm trying to convert the MediaFile into a Blob but most of the data is wrong.
I have the same problems as you, also the single MediaFile has a field named "localURL" which will be usefull but it is not accessible for some reason.
This will be a problem with the awesome-cordova-plugin wrapper, rather than this project. I spotted it too, but it's still got the wrong filename for the photo.
Have someone resolve the problem? I have similar issue on Lenovo tab10. Cordova android 11