fixed stretched spurdo in notifications, misc fixes, detect gif by extension for now

This commit is contained in:
Henry Jameson 2018-02-03 20:32:13 +03:00
parent 3257991f41
commit 55bc1a3414
4 changed files with 13 additions and 14 deletions

View file

@ -12,14 +12,8 @@ const StillImage = {
}
},
computed: {
animated: {
get () {
// If mimetype is gif then it is certainly animated, if it's undefined - we don't know YET
return this.mimetype === 'image/gif' ? true : this.mimetype == null ? 'maybe' : false
},
set (val) {
this.mimetype = val
}
animated () {
return this.mimetype === 'image/gif' || this.src.endsWith('.gif')
}
},
methods: {
@ -27,12 +21,6 @@ const StillImage = {
const canvas = this.$refs.canvas
if (!canvas) return
canvas.getContext('2d').drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height)
if (this.animated === 'maybe') {
fetch(this.src).then((data) => {
console.log(data)
this.animated = data.type
})
}
}
}
}