Only enable alpha is output mode support alpha (GIF/PNG output)

This commit is contained in:
N00MKRAD
2021-01-27 20:59:29 +01:00
parent 2c872629fb
commit ea80c2d28d
2 changed files with 6 additions and 3 deletions

View File

@@ -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)
{