From 7653e72e88b004764c9f1bce4cfce3332f647f72 Mon Sep 17 00:00:00 2001 From: mikiher Date: Wed, 9 Oct 2024 15:04:25 +0300 Subject: [PATCH 1/2] Use object-cover for author images unless AR is really high or low. --- client/components/covers/AuthorImage.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/components/covers/AuthorImage.vue b/client/components/covers/AuthorImage.vue index b4fb3cca..0073a958 100644 --- a/client/components/covers/AuthorImage.vue +++ b/client/components/covers/AuthorImage.vue @@ -72,8 +72,7 @@ export default { if (this.$refs.img) { var { naturalWidth, naturalHeight } = this.$refs.img var imgAr = naturalHeight / naturalWidth - var arDiff = Math.abs(imgAr - aspectRatio) - if (arDiff > 0.15) { + if (imgAr < 0.5 || imgAr > 2) { this.showCoverBg = true } else { this.showCoverBg = false From cfae607310b51384ed66e102e279e26bffbefa17 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 9 Oct 2024 17:22:38 -0500 Subject: [PATCH 2/2] AuthorImage remove aspectRatio unused var --- client/components/covers/AuthorImage.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/components/covers/AuthorImage.vue b/client/components/covers/AuthorImage.vue index 0073a958..af8a394f 100644 --- a/client/components/covers/AuthorImage.vue +++ b/client/components/covers/AuthorImage.vue @@ -65,10 +65,6 @@ export default { }, methods: { imageLoaded() { - var aspectRatio = 1.25 - if (this.$refs.wrapper) { - aspectRatio = this.$refs.wrapper.clientHeight / this.$refs.wrapper.clientWidth - } if (this.$refs.img) { var { naturalWidth, naturalHeight } = this.$refs.img var imgAr = naturalHeight / naturalWidth