aboutsummaryrefslogtreecommitdiff
path: root/src/components/still-image/still-image.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/still-image/still-image.js')
-rw-r--r--src/components/still-image/still-image.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js
new file mode 100644
index 00000000..fa027bc4
--- /dev/null
+++ b/src/components/still-image/still-image.js
@@ -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