mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-23 11:49:34 +01:00
Only enable alpha is output mode support alpha (GIF/PNG output)
This commit is contained in:
@@ -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)
|
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...");
|
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);
|
IOUtils.CreateDir(outpath);
|
||||||
string concatFile = Path.Combine(Paths.GetDataPath(), "png-concat-temp.ini");
|
string concatFile = Path.Combine(Paths.GetDataPath(), "png-concat-temp.ini");
|
||||||
string concatFileContent = "";
|
string concatFileContent = "";
|
||||||
|
|||||||
@@ -116,10 +116,13 @@ namespace Flowframes
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
bool alphaEnabled = Config.GetBool("enableAlpha", false);
|
||||||
|
bool outputSupportsAlpha = (outMode == Interpolate.OutMode.ImgPng || outMode == Interpolate.OutMode.VidGif);
|
||||||
|
|
||||||
if (!inputIsFrames)
|
if (!inputIsFrames)
|
||||||
alpha = (Config.GetBool("enableAlpha", false) && (Path.GetExtension(inPath).ToLower() == ".gif"));
|
alpha = (alphaEnabled && outputSupportsAlpha && (Path.GetExtension(inPath).ToLower() == ".gif"));
|
||||||
else
|
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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user