From 9206cfd800e6e9db0096147a775cfbc12a2c0f37 Mon Sep 17 00:00:00 2001 From: RZK <36767782+ahmad-rzk@users.noreply.github.com> Date: Sun, 27 Sep 2020 22:09:24 +0300 Subject: [PATCH] Use Custom Height & Width properties for Thumbnail size --- MediaToolkit src/MediaToolkit/CommandBuilder.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MediaToolkit src/MediaToolkit/CommandBuilder.cs b/MediaToolkit src/MediaToolkit/CommandBuilder.cs index 127936e..5b909ef 100644 --- a/MediaToolkit src/MediaToolkit/CommandBuilder.cs +++ b/MediaToolkit src/MediaToolkit/CommandBuilder.cs @@ -39,6 +39,13 @@ private static string GetThumbnail(MediaFile inputFile, MediaFile outputFile, Co commandBuilder.AppendFormat(" -i \"{0}\" ", inputFile.Filename); commandBuilder.AppendFormat(" -vframes {0} ", 1); + + if (conversionOptions != null + && conversionOptions.CustomWidth != null + && conversionOptions.CustomHeight != null) + { + commandBuilder.AppendFormat(" -s {0}*{1} ", conversionOptions.CustomWidth, conversionOptions.CustomHeight); + } return commandBuilder.AppendFormat(" \"{0}\" ", outputFile.Filename).ToString(); }