From ea80c2d28d8d1e10a890b7b24db0d2c4e5bb5dea Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Wed, 27 Jan 2021 20:59:29 +0100 Subject: [PATCH] Only enable alpha is output mode support alpha (GIF/PNG output) --- Code/AudioVideo/FFmpegCommands.cs | 2 +- Code/Data/InterpSettings.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Code/AudioVideo/FFmpegCommands.cs b/Code/AudioVideo/FFmpegCommands.cs index 49532e3..ac8fff6 100644 --- a/Code/AudioVideo/FFmpegCommands.cs +++ b/Code/AudioVideo/FFmpegCommands.cs @@ -60,7 +60,7 @@ namespace Flowframes public static async Task ImportImages(string inpath, string outpath, bool alpha, Size size, bool delSrc = false, bool showLog = true) { if (showLog) Logger.Log("Importing images..."); - Logger.Log($"Importing images from {inpath} to {outpath}."); + Logger.Log($"Importing images from {inpath} to {outpath}.", true); IOUtils.CreateDir(outpath); string concatFile = Path.Combine(Paths.GetDataPath(), "png-concat-temp.ini"); string concatFileContent = ""; diff --git a/Code/Data/InterpSettings.cs b/Code/Data/InterpSettings.cs index 77d0265..04f2f03 100644 --- a/Code/Data/InterpSettings.cs +++ b/Code/Data/InterpSettings.cs @@ -116,10 +116,13 @@ namespace Flowframes { try { + bool alphaEnabled = Config.GetBool("enableAlpha", false); + bool outputSupportsAlpha = (outMode == Interpolate.OutMode.ImgPng || outMode == Interpolate.OutMode.VidGif); + if (!inputIsFrames) - alpha = (Config.GetBool("enableAlpha", false) && (Path.GetExtension(inPath).ToLower() == ".gif")); + alpha = (alphaEnabled && outputSupportsAlpha && (Path.GetExtension(inPath).ToLower() == ".gif")); else - alpha = (Config.GetBool("enableAlpha", false) && Path.GetExtension(IOUtils.GetFilesSorted(inPath).First()).ToLower() == ".gif"); + alpha = (alphaEnabled && outputSupportsAlpha && Path.GetExtension(IOUtils.GetFilesSorted(inPath).First()).ToLower() == ".gif"); } catch (Exception e) {