我试图从库中获取图像的路径和文件名,但它在名称之前返回扩展名(.pic.jpg),例如:
file:///storage/emulated/0/Android/data/com.example.app/cache/.Pic.jpg.filename
当我从相机获取图像时,它可以正常工作。
我的代码:
function getPhoto() {
// Retrieve image file location from specified source
navigator.camera.getPicture(onPhotoURISuccess, onFail, {
quality: 25,
allowEdit: true,
correctOrientation: true,
destinationType: Camera.DestinationType.FILE_URI,
encodingType: Camera.EncodingType.JPEG,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY, });
}