Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Bug: Capacitor Camera plugin never sets image.path in CameraPhoto result

$
0
0

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?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>