From 29fc57498a1aa68b1ef596f2a83b9bfc0052fe97 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 15 Oct 2022 21:26:01 -0700 Subject: [PATCH] Fix thumb size --- src/components/frame/Photo.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/frame/Photo.vue b/src/components/frame/Photo.vue index 710905a1..71967ebf 100644 --- a/src/components/frame/Photo.vue +++ b/src/components/frame/Photo.vue @@ -82,7 +82,11 @@ export default class Photo extends Mixins(GlobalMixin) { /** Get url of the photo */ get url() { - return getPreviewUrl(this.data.fileid, this.data.etag, false, 512) + let size = 256; + if (this.data.w && this.data.h) { + size = Math.floor(size * Math.max(this.data.w, this.data.h) / Math.min(this.data.w, this.data.h)); + } + return getPreviewUrl(this.data.fileid, this.data.etag, false, size) } /** Image loaded successfully */