From de93e6208dc8d87d29f8a2b3ccc8582771599647 Mon Sep 17 00:00:00 2001 From: gaesa <71256557+gaesa@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:07:57 +0000 Subject: [PATCH] fix: avoid upscaling for the video previewer (#2007) Co-authored-by: sxyazi --- yazi-config/preset/README.md | 2 +- yazi-plugin/preset/plugins/video.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yazi-config/preset/README.md b/yazi-config/preset/README.md index 93b742d3..a89966a4 100644 --- a/yazi-config/preset/README.md +++ b/yazi-config/preset/README.md @@ -1,7 +1,7 @@ # Default Configuration > [!IMPORTANT] -> If you're using a stable release of Yazi instead of the latest nightly build, make sure you're checking these files from [the shipped tag][shipped], not the latest main branch. +> If you're using a stable release of Yazi instead of the latest nightly build, make sure you're checking these files from [the `shipped` tag][shipped], not the latest main branch. This directory contains the default configuration files for Yazi: diff --git a/yazi-plugin/preset/plugins/video.lua b/yazi-plugin/preset/plugins/video.lua index 832e1476..93b50c7f 100644 --- a/yazi-plugin/preset/plugins/video.lua +++ b/yazi-plugin/preset/plugins/video.lua @@ -56,7 +56,7 @@ function M:preload(job) "-i", tostring(job.file.url), "-vframes", 1, "-q:v", qv, - "-vf", string.format("scale=%d:-2:flags=fast_bilinear", PREVIEW.max_width), + "-vf", string.format("scale=-1:'min(%d,ih)':flags=fast_bilinear", PREVIEW.max_height), "-f", "image2", "-y", tostring(cache), }):status()