Skip to content

Commit

Permalink
added FLIF format options to switch from Magick.NET encoder to flif.e…
Browse files Browse the repository at this point in the history
…xe wrapper
  • Loading branch information
N00MKRAD committed Oct 18, 2020
1 parent 7b9a948 commit 56c08a0
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 16 deletions.
Binary file modified .vs/MagickUtils/v16/.suo
Binary file not shown.
59 changes: 50 additions & 9 deletions Forms/FlifOptionsWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Forms/FlifOptionsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ private void doneBtn_Click (object sender, EventArgs e)

private void effortCombox_SelectedIndexChanged (object sender, EventArgs e)
{
FlifInterface.effort = int.Parse(effortCombox.Text.Trim());
FlifInterface.effort = effortCombox.GetInt();
}

private void FlifOptionsWindow_Load (object sender, EventArgs e)
{
CenterToScreen();
UpdateUI();
flifEnc.SelectedIndex = 0;
}

void UpdateUI ()
{
effortCombox.Text = FlifInterface.effort.ToString();
}

private void flifEnc_SelectedIndexChanged(object sender, EventArgs e)
{
FormatOptions.flifUseWrapper = flifEnc.SelectedIndex == 1;
flifWrapperPanel.Visible = flifEnc.SelectedIndex == 1;
}
}
}
9 changes: 6 additions & 3 deletions FormsHelpers/ConvertTabHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ public static void ConvertFileList (string[] files, ComboBox qualityCombox, Comb
ConvertUtils.ConvertToJpeg2000(file, qMin, delSrcCbox.Checked);

if(selectedFormat == IF.FLIF)
FlifInterface.EncodeImage(file, qMin, delSrcCbox.Checked);

{
if(FormatOptions.flifUseWrapper) FlifInterface.EncodeImage(file, qMin, delSrcCbox.Checked);
else ConvertUtils.ConvertToFlif(file, qMin, delSrcCbox.Checked);
}

if (selectedFormat == IF.BMP)
ConvertUtils.ConvertToBmp(file, delSrcCbox.Checked);

Expand Down Expand Up @@ -88,7 +91,7 @@ public static void ConvertUsingPath (ComboBox qualityCombox, ComboBox qualityMax
ConvertUtils.ConvertDirToJpeg2000(qMin, delSrcCbox.Checked);

if(selectedFormat == IF.FLIF)
ConvertUtils.ConvertDirToFlif(qMin, delSrcCbox.Checked);
ConvertUtils.ConvertDirToFlif(FormatOptions.flifUseWrapper, qMin, delSrcCbox.Checked);

if (selectedFormat == IF.BMP)
ConvertUtils.ConvertDirToBmp(delSrcCbox.Checked);
Expand Down
8 changes: 5 additions & 3 deletions MagickUtils/ConvertUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static async void ConvertDirToJpeg2000 (int q, bool delSrc)
Program.PostProcessing();
}

public static async void ConvertDirToFlif (int q, bool delSrc)
public static async void ConvertDirToFlif (bool useFlifExe, int q, bool delSrc)
{
int counter = 1;
FileInfo[] files = IOUtils.GetFiles();
Expand All @@ -136,8 +136,10 @@ public static async void ConvertDirToFlif (int q, bool delSrc)
{
Program.ShowProgress("Converting Image ", counter, files.Length);
counter++;
//FlifInterface.EncodeImage(file.FullName, q, delSrc);
ConvertToFlif(file.FullName, q, delSrc);
if(useFlifExe)
FlifInterface.EncodeImage(file.FullName, q, delSrc);
else
ConvertToFlif(file.FullName, q, delSrc);
await Program.PutTaskDelay();
}
Program.PostProcessing();
Expand Down
1 change: 1 addition & 0 deletions Utils/FormatOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ namespace MagickUtils
class FormatOptions
{
public static bool ddsUseCrunch = false;
public static bool flifUseWrapper = false;
}
}
Binary file modified bin/Debug/MagickUtils.exe
Binary file not shown.
Binary file modified bin/Debug/MagickUtils.pdb
Binary file not shown.
Binary file modified obj/Debug/MagickUtils.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified obj/Debug/MagickUtils.csprojAssemblyReference.cache
Binary file not shown.
Binary file modified obj/Debug/MagickUtils.exe
Binary file not shown.
Binary file modified obj/Debug/MagickUtils.pdb
Binary file not shown.

0 comments on commit 56c08a0

Please sign in to comment.