From bef481057a736f6fdf9c99e0b9043220c9475d68 Mon Sep 17 00:00:00 2001 From: ze0987 Date: Fri, 11 Apr 2025 07:23:01 +0200 Subject: [PATCH] fix: respect the user's `max_width` setting for the built-in video previewer (#2560) Co-authored-by: sxyazi --- yazi-plugin/preset/plugins/video.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yazi-plugin/preset/plugins/video.lua b/yazi-plugin/preset/plugins/video.lua index 1bc118a4..e9ca2f1d 100644 --- a/yazi-plugin/preset/plugins/video.lua +++ b/yazi-plugin/preset/plugins/video.lua @@ -60,7 +60,7 @@ function M:preload(job) "-i", tostring(job.file.url), "-vframes", 1, "-q:v", qv, - "-vf", string.format("scale=-1:'min(%d,ih)':flags=fast_bilinear", rt.preview.max_height), + "-vf", string.format("scale='min(%d,iw)':'min(%d,ih)':force_original_aspect_ratio=decrease:flags=fast_bilinear", rt.preview.max_width, rt.preview.max_height), "-f", "image2", "-y", tostring(cache), }):status()