diff --git a/Code/Main/Interpolate.cs b/Code/Main/Interpolate.cs index 049594a..9c67bf0 100644 --- a/Code/Main/Interpolate.cs +++ b/Code/Main/Interpolate.cs @@ -36,7 +36,7 @@ namespace Flowframes canceled = false; Program.initialRun = false; Program.mainForm.SetWorking(true); - if (!Utils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.outMode)) return; // General input checks + if (!Utils.InputIsValid(current.inPath, current.outPath, current.inFps, current.interpFactor, current.outMode)) return; // General input checks if (!Utils.CheckAiAvailable(current.ai, current.model)) return; // Check if selected AI pkg is installed if (!ResumeUtils.resumeNextRun && !Utils.CheckDeleteOldTempFolder()) return; // Try to delete temp folder if an old one exists if (!Utils.CheckPathValid(current.inPath)) return; // Check if input path/file is valid diff --git a/Code/Main/InterpolateSteps.cs b/Code/Main/InterpolateSteps.cs index 00d4ea7..1f1d9e7 100644 --- a/Code/Main/InterpolateSteps.cs +++ b/Code/Main/InterpolateSteps.cs @@ -33,7 +33,7 @@ namespace Flowframes.Main current.RefreshAlpha(); current.stepByStep = true; - if (!InterpolateUtils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.outMode)) return; // General input checks + if (!InterpolateUtils.InputIsValid(current.inPath, current.outPath, current.inFps, current.interpFactor, current.outMode)) return; // General input checks if (!InterpolateUtils.CheckPathValid(current.inPath)) return; // Check if input path/file is valid if (step.Contains("Extract Frames")) diff --git a/Code/Main/InterpolateUtils.cs b/Code/Main/InterpolateUtils.cs index 5b4d7e6..dd91535 100644 --- a/Code/Main/InterpolateUtils.cs +++ b/Code/Main/InterpolateUtils.cs @@ -94,13 +94,13 @@ namespace Flowframes.Main return Path.Combine(basePath, Path.GetFileNameWithoutExtension(inPath).StripBadChars().Remove(" ").Trunc(30, false) + "-temp"); } - public static bool InputIsValid(string inDir, string outDir, Fraction fpsOut, float factor, I.OutMode outMode) + public static bool InputIsValid(string inDir, string outDir, Fraction fpsIn, float factor, I.OutMode outMode) { try { bool passes = true; - bool isFile = !IoUtils.IsPathDirectory(inDir); + float fpsOut = fpsIn.GetFloat() * factor; if ((passes && isFile && !IoUtils.IsFileValid(inDir)) || (!isFile && !IoUtils.IsDirValid(inDir))) { @@ -114,18 +114,18 @@ namespace Flowframes.Main passes = false; } - if (passes && fpsOut.GetFloat() < 1f || fpsOut.GetFloat() > 1000f) + if (passes && fpsOut < 1f || fpsOut > 1000f) { string imgSeqNote = isFile ? "" : "\n\nWhen using an image sequence as input, you always have to specify the frame rate manually."; - ShowMessage($"Invalid output frame rate ({fpsOut.GetFloat()}).\nMust be 1-1000.{imgSeqNote}"); + ShowMessage($"Invalid output frame rate ({fpsOut}).\nMust be 1-1000.{imgSeqNote}"); passes = false; } string fpsLimitValue = Config.Get(Config.Key.maxFps); float fpsLimit = (fpsLimitValue.Contains("/") ? new Fraction(Config.Get(Config.Key.maxFps)).GetFloat() : fpsLimitValue.GetFloat()); - if (outMode == I.OutMode.VidGif && fpsOut.GetFloat() > 50 && !(fpsLimit > 0 && fpsLimit <= 50)) - Logger.Log($"Warning: GIF will be encoded at 50 FPS instead of {fpsOut.GetFloat()} as the format doesn't support frame rates that high."); + if (outMode == I.OutMode.VidGif && fpsOut > 50 && !(fpsLimit > 0 && fpsLimit <= 50)) + Logger.Log($"Warning: GIF will be encoded at 50 FPS instead of {fpsOut} as the format doesn't support frame rates that high."); if (!passes) I.Cancel("Invalid settings detected.", true);