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

Filesystem.stat() fails to find entry

$
0
0

I am trying to get the creation date from a picture using @capacitor/filesystem and its stat() method

However the call to stat() fails at :

ERROR Error: Uncaught (in promise): Error: Entry does not exist.
Error: Entry does not exist.
    at web.js:327:19

I am debugging this on my computer right now (web). Haven’t tested on device yet.

The code fails both when taking a picture with the camera and when selecting a pic from the local Documents folder.

My code:

import { Filesystem, Directory } from '@capacitor/filesystem'
let image = await this.takePicture()
                      
let fileStats = await Filesystem.stat(
  {
    path : image.webPath,
    directory: Directory.Documents,
  })
console.log(fileStats);

where takePicure() is

const image = await Camera.getPhoto({
    quality: 40,
    allowEditing: false,
    source: CameraSource.Camera,
    resultType: CameraResultType.Uri
  });
  
  image["base64"] = await convertToBase64(image.webPath)
  image["exif"] = await getExif(image.webPath)
 
  return image

The image object is

base64: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvA
exif: "{\n    \"BitDepth\": 8,\n    \"ColorType\": \"RGB with Alpha\",\n    \"Compression\": \"Deflate/Inflate\",\n    \"Filter\": \"Adaptive\",\n    \"ImageHeight\": 590,\n    \"ImageWidth\": 752,\n    \"Interlace\": \"Noninterlaced\"\n}"
format: "png"
saved: false
webPath: "blob:http://localhost:8100/91951516-56d7-4917-841d-790fe39b4cd1"

I must be missing something very obvious. Any help would be much appreciated

update 1 : also tried with no success:

let fileStats = await Filesystem.stat(
  {
    path : image.webPath
   })

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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