first ver
This commit is contained in:
parent
cd3bf461db
commit
b10787d23c
4 changed files with 85 additions and 1 deletions
29
src/components/still-image/still-image.js
Normal file
29
src/components/still-image/still-image.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
import fileTypeService from '../../services/file_type/file_type.service.js'
|
||||
|
||||
const StillImage = {
|
||||
props: [
|
||||
'src',
|
||||
'referrerpolicy',
|
||||
'mimetype'
|
||||
],
|
||||
data () {
|
||||
return {
|
||||
hideNsfwLocal: this.$store.state.config.hideNsfw,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
animated () {
|
||||
return this.mimetype === 'image/gif'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
drawCanvas() {
|
||||
const canvas = this.$refs.canvas
|
||||
if (!canvas) return
|
||||
const ctx = canvas.getContext('2d')
|
||||
ctx.drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default StillImage
|
Loading…
Add table
Add a link
Reference in a new issue