From 42a13b0f1b2d0a3786f5c86883b1397a50891ed3 Mon Sep 17 00:00:00 2001 From: Mergan Date: Tue, 12 Sep 2023 03:05:42 -0700 Subject: [PATCH] Modify label --- src/components/still-image/still-image.js | 7 ++++ src/components/still-image/still-image.vue | 40 ++++++++++++---------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index 963bb1ac..93fa0022 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -13,6 +13,7 @@ const StillImage = { return { stopGifs: this.$store.getters.mergedConfig.stopGifs || window.matchMedia('(prefers-reduced-motion: reduce)').matches, isAnimated: false, + imageTypeLabel: '' } }, computed: { @@ -62,14 +63,17 @@ const StillImage = { // Ordered from least to most intensive if (this.isGIF(reader.value)) { this.isAnimated = true + this.setLabel('GIF') return } if (this.isAnimatedWEBP(reader.value)) { this.isAnimated = true + this.setLabel('WEBP') return } if (this.isAnimatedPNG(reader.value)) { this.isAnimated = true + this.setLabel('APNG') } }) }) @@ -77,6 +81,9 @@ const StillImage = { // this.imageLoadError && this.imageLoadError() }) }, + setLabel (name) { + this.imageTypeLabel = name; + }, isGIF (data) { // I am a perfectly sane individual // diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 68e4ca49..d1d4e890 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -1,9 +1,15 @@