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