From da12ee452c29d89864496502561130e535319565 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 10 Jun 2024 23:40:33 +0200 Subject: [PATCH] Get aard to start reliably if it's set as default aspect ratio for the site --- src/ext/lib/video-transform/Resizer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ext/lib/video-transform/Resizer.ts b/src/ext/lib/video-transform/Resizer.ts index 199748c..71dfb50 100644 --- a/src/ext/lib/video-transform/Resizer.ts +++ b/src/ext/lib/video-transform/Resizer.ts @@ -141,6 +141,11 @@ class Resizer { this.stretcher = new Stretcher(this.videoData); this.zoom = new Zoom(this.videoData); + const defaultCrop = this.siteSettings.getDefaultOption('crop') as {type: AspectRatioType, ratio?: number }; + if (defaultCrop.type !== AspectRatioType.Reset) { + this.lastAr = defaultCrop; + } + this.videoAlignment = this.siteSettings.getDefaultOption('alignment') as {x: VideoAlignmentType, y: VideoAlignmentType} // this is initial video alignment this.destroyed = false;