Fix decoding error on android image load (#108)
Closes: #105 Signed-off-by: Justin Georgi <justin.georgi@gmail.com> Reviewed-on: Georgi_Lab/ALVINN_f7#108
This commit is contained in:
@@ -463,6 +463,8 @@
|
|||||||
self.uploadDirty = true
|
self.uploadDirty = true
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e.message)
|
console.log(e.message)
|
||||||
|
self.detecting = false
|
||||||
|
self.resultData = {}
|
||||||
f7.dialog.alert(`ALVINN structure finding error: ${e.message}`)
|
f7.dialog.alert(`ALVINN structure finding error: ${e.message}`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -542,7 +544,7 @@
|
|||||||
} else {
|
} else {
|
||||||
const searchImage = this.$refs.image_chooser.files[0]
|
const searchImage = this.$refs.image_chooser.files[0]
|
||||||
var reader = new FileReader()
|
var reader = new FileReader()
|
||||||
reader.addEventListener("loadend", () => {
|
reader.addEventListener("load", () => {
|
||||||
this.detecting = true
|
this.detecting = true
|
||||||
resolve(reader.result)
|
resolve(reader.result)
|
||||||
})
|
})
|
||||||
@@ -552,6 +554,7 @@
|
|||||||
loadImage.then((imgData) => {
|
loadImage.then((imgData) => {
|
||||||
this.imageLoaded = true
|
this.imageLoaded = true
|
||||||
this.resultData = {}
|
this.resultData = {}
|
||||||
|
this.selectedChip = -1
|
||||||
this.imageView = new Image()
|
this.imageView = new Image()
|
||||||
this.imageView.src = imgData
|
this.imageView.src = imgData
|
||||||
return(this.imageView.decode())
|
return(this.imageView.decode())
|
||||||
@@ -559,10 +562,8 @@
|
|||||||
const [imCanvas, _] = this.resetView()
|
const [imCanvas, _] = this.resetView()
|
||||||
imCanvas.style['background-image'] = `url(${this.imageView.src})`
|
imCanvas.style['background-image'] = `url(${this.imageView.src})`
|
||||||
/******
|
/******
|
||||||
* setTimeout is not a good solution,
|
* setTimeout is not a good solution, but it's the only way
|
||||||
* but it's the only way I can find to
|
* I can find to not cut off drawing of the progress spinner
|
||||||
* not cut off drawing of of the progress
|
|
||||||
* spinner
|
|
||||||
******/
|
******/
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.setData()
|
this.setData()
|
||||||
|
|||||||
Reference in New Issue
Block a user