Fix Android sample image fetching

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-03-14 16:35:56 -07:00
parent c6f17d7187
commit c16e44016b

View File

@@ -361,10 +361,13 @@
resolve(reader.result) resolve(reader.result)
}) })
if (this.imageLoadMode == 'sample') { if (this.imageLoadMode == 'sample') {
fetch(`../samples/${this.detectorName}-${searchImage}.jpeg`).then( resp => { fetch(`${this.isCordova ? 'https://localhost' : '..'}/samples/${this.detectorName}-${searchImage}.jpeg`).then( resp => {
return resp.blob() return resp.blob()
}).then(respBlob => { }).then(respBlob => {
reader.readAsDataURL(respBlob) reader.readAsDataURL(respBlob)
}).catch((e) => {
console.log(e.message)
f7.dialog.alert(`Error loading image: ${e.message}`)
}) })
} else { } else {
const fileImage = this.$refs.image_chooser.files[0] const fileImage = this.$refs.image_chooser.files[0]