The documentation from the Camera plugin has the following example:
import { Plugins, CameraResultType } from '@capacitor/core';
const { Camera } = Plugins;
async takePicture() {
const image = await Camera.getPhoto({
quality: 90,
allowEditing: true,
resultType: CameraResultType.Uri
});
// image.webPath will contain a path that can be set as an image src.
// You can access the original file using image.path, which can be
// passed to the Filesystem API to read the raw data of the image,
// if desired (or pass resultType: CameraResultType.Base64 to getPhoto)
var imageUrl = image.webPath;
// Can be set to the src of an image now
imageElement.src = imageUrl;
}
This mentions that the image.path
property of the result can be used to read the raw photo data.
However, no matter which CameraResultType I try, this property is always undefined
.
I need to read the raw file to process it before uploading to Firebase Storage as a Blob.
Is this a bug or am I doing something wrong here?