Fix Android sample image fetching
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -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]
|
||||||
|
|||||||
Reference in New Issue
Block a user