diff --git a/.vs/MagickUtils/v16/.suo b/.vs/MagickUtils/v16/.suo index 0d71edb..0fa2cd9 100644 Binary files a/.vs/MagickUtils/v16/.suo and b/.vs/MagickUtils/v16/.suo differ diff --git a/Forms/FlifOptionsWindow.Designer.cs b/Forms/FlifOptionsWindow.Designer.cs index c6661ca..dfd9b75 100644 --- a/Forms/FlifOptionsWindow.Designer.cs +++ b/Forms/FlifOptionsWindow.Designer.cs @@ -33,6 +33,10 @@ private void InitializeComponent () this.label10 = new System.Windows.Forms.Label(); this.label31 = new System.Windows.Forms.Label(); this.effortCombox = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.flifEnc = new System.Windows.Forms.ComboBox(); + this.flifWrapperPanel = new System.Windows.Forms.Panel(); + this.flifWrapperPanel.SuspendLayout(); this.SuspendLayout(); // // doneBtn @@ -51,7 +55,7 @@ private void InitializeComponent () this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); this.label1.Location = new System.Drawing.Point(8, 9); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(319, 20); + this.label1.Size = new System.Drawing.Size(373, 24); this.label1.TabIndex = 26; this.label1.Text = "FLIF (Free Lossless Image Format) Options"; // @@ -59,7 +63,7 @@ private void InitializeComponent () // this.label10.AutoSize = true; this.label10.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label10.Location = new System.Drawing.Point(264, 70); + this.label10.Location = new System.Drawing.Point(280, 3); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(154, 13); this.label10.TabIndex = 30; @@ -70,9 +74,9 @@ private void InitializeComponent () this.label31.AutoSize = true; this.label31.Location = new System.Drawing.Point(12, 70); this.label31.Name = "label31"; - this.label31.Size = new System.Drawing.Size(80, 13); + this.label31.Size = new System.Drawing.Size(71, 13); this.label31.TabIndex = 29; - this.label31.Text = "Encoding Effort"; + this.label31.Text = "FLIF Encoder"; // // effortCombox // @@ -84,27 +88,61 @@ private void InitializeComponent () "40", "20", "0"}); - this.effortCombox.Location = new System.Drawing.Point(153, 67); + this.effortCombox.Location = new System.Drawing.Point(149, 0); this.effortCombox.Name = "effortCombox"; - this.effortCombox.Size = new System.Drawing.Size(100, 21); + this.effortCombox.Size = new System.Drawing.Size(125, 21); this.effortCombox.TabIndex = 31; this.effortCombox.Text = "50"; this.effortCombox.SelectedIndexChanged += new System.EventHandler(this.effortCombox_SelectedIndexChanged); // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(7, 3); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(80, 13); + this.label2.TabIndex = 32; + this.label2.Text = "Encoding Effort"; + // + // flifEnc + // + this.flifEnc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.flifEnc.FormattingEnabled = true; + this.flifEnc.Items.AddRange(new object[] { + "Magick.NET Native", + "flif.exe Wrapper"}); + this.flifEnc.Location = new System.Drawing.Point(154, 67); + this.flifEnc.Name = "flifEnc"; + this.flifEnc.Size = new System.Drawing.Size(125, 21); + this.flifEnc.TabIndex = 33; + this.flifEnc.SelectedIndexChanged += new System.EventHandler(this.flifEnc_SelectedIndexChanged); + // + // flifWrapperPanel + // + this.flifWrapperPanel.Controls.Add(this.effortCombox); + this.flifWrapperPanel.Controls.Add(this.label10); + this.flifWrapperPanel.Controls.Add(this.label2); + this.flifWrapperPanel.Location = new System.Drawing.Point(5, 94); + this.flifWrapperPanel.Name = "flifWrapperPanel"; + this.flifWrapperPanel.Size = new System.Drawing.Size(447, 54); + this.flifWrapperPanel.TabIndex = 34; + // // FlifOptionsWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(464, 236); - this.Controls.Add(this.effortCombox); - this.Controls.Add(this.label10); + this.Controls.Add(this.flifWrapperPanel); + this.Controls.Add(this.flifEnc); this.Controls.Add(this.label31); this.Controls.Add(this.doneBtn); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "FlifOptionsWindow"; - this.Text = "FlifOptionsWindow"; + this.Text = "FLIF Format Options"; this.Load += new System.EventHandler(this.FlifOptionsWindow_Load); + this.flifWrapperPanel.ResumeLayout(false); + this.flifWrapperPanel.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -117,5 +155,8 @@ private void InitializeComponent () private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label31; private System.Windows.Forms.ComboBox effortCombox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox flifEnc; + private System.Windows.Forms.Panel flifWrapperPanel; } } \ No newline at end of file diff --git a/Forms/FlifOptionsWindow.cs b/Forms/FlifOptionsWindow.cs index f49acd4..7d625f0 100644 --- a/Forms/FlifOptionsWindow.cs +++ b/Forms/FlifOptionsWindow.cs @@ -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; + } } } diff --git a/FormsHelpers/ConvertTabHelper.cs b/FormsHelpers/ConvertTabHelper.cs index 00c0e11..cea40ec 100644 --- a/FormsHelpers/ConvertTabHelper.cs +++ b/FormsHelpers/ConvertTabHelper.cs @@ -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); @@ -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); diff --git a/MagickUtils/ConvertUtils.cs b/MagickUtils/ConvertUtils.cs index baeb2df..906c40e 100644 --- a/MagickUtils/ConvertUtils.cs +++ b/MagickUtils/ConvertUtils.cs @@ -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(); @@ -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(); diff --git a/Utils/FormatOptions.cs b/Utils/FormatOptions.cs index 48742bf..c9c96e1 100644 --- a/Utils/FormatOptions.cs +++ b/Utils/FormatOptions.cs @@ -9,5 +9,6 @@ namespace MagickUtils class FormatOptions { public static bool ddsUseCrunch = false; + public static bool flifUseWrapper = false; } } diff --git a/bin/Debug/MagickUtils.exe b/bin/Debug/MagickUtils.exe index e41fc05..c66904c 100644 Binary files a/bin/Debug/MagickUtils.exe and b/bin/Debug/MagickUtils.exe differ diff --git a/bin/Debug/MagickUtils.pdb b/bin/Debug/MagickUtils.pdb index 6eb43e9..efbc111 100644 Binary files a/bin/Debug/MagickUtils.pdb and b/bin/Debug/MagickUtils.pdb differ diff --git a/obj/Debug/MagickUtils.csproj.GenerateResource.cache b/obj/Debug/MagickUtils.csproj.GenerateResource.cache index bd4bf6a..1f8dcca 100644 Binary files a/obj/Debug/MagickUtils.csproj.GenerateResource.cache and b/obj/Debug/MagickUtils.csproj.GenerateResource.cache differ diff --git a/obj/Debug/MagickUtils.csprojAssemblyReference.cache b/obj/Debug/MagickUtils.csprojAssemblyReference.cache index 9b31d5e..64778f8 100644 Binary files a/obj/Debug/MagickUtils.csprojAssemblyReference.cache and b/obj/Debug/MagickUtils.csprojAssemblyReference.cache differ diff --git a/obj/Debug/MagickUtils.exe b/obj/Debug/MagickUtils.exe index e41fc05..c66904c 100644 Binary files a/obj/Debug/MagickUtils.exe and b/obj/Debug/MagickUtils.exe differ diff --git a/obj/Debug/MagickUtils.pdb b/obj/Debug/MagickUtils.pdb index 6eb43e9..efbc111 100644 Binary files a/obj/Debug/MagickUtils.pdb and b/obj/Debug/MagickUtils.pdb differ