Enabled alpha support for PNG (APNG) input

This commit is contained in:
N00MKRAD
2021-01-30 01:42:32 +01:00
parent b9ccbc3f36
commit 7d111d044d

View File

@@ -118,11 +118,8 @@ namespace Flowframes
{ {
bool alphaEnabled = Config.GetBool("enableAlpha", false); bool alphaEnabled = Config.GetBool("enableAlpha", false);
bool outputSupportsAlpha = (outMode == Interpolate.OutMode.ImgPng || outMode == Interpolate.OutMode.VidGif); bool outputSupportsAlpha = (outMode == Interpolate.OutMode.ImgPng || outMode == Interpolate.OutMode.VidGif);
string ext = inputIsFrames ? Path.GetExtension(IOUtils.GetFilesSorted(inPath).First()).ToLower() : Path.GetExtension(inPath).ToLower();
if (!inputIsFrames) alpha = (alphaEnabled && outputSupportsAlpha && (ext == ".gif" || ext == ".png" || ext == ".apng"));
alpha = (alphaEnabled && outputSupportsAlpha && (Path.GetExtension(inPath).ToLower() == ".gif"));
else
alpha = (alphaEnabled && outputSupportsAlpha && Path.GetExtension(IOUtils.GetFilesSorted(inPath).First()).ToLower() == ".gif");
} }
catch (Exception e) catch (Exception e)
{ {