add support for png in origs folder

This commit is contained in:
tomse 2023-12-27 15:14:27 +01:00
parent 6f16cb7bda
commit 93cb62d94b
2 changed files with 12 additions and 1 deletions

View File

@ -279,7 +279,9 @@ namespace PDFWorkflowManager
MessageBox.Show("Origs dir not found.", "Origs dir not found.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
else if (Directory.GetFiles(Path.Combine(txtProjectDir.Text, Properties.Settings.Default.OrigsDir), "*.tif").Length == 0 && Directory.GetFiles(Path.Combine(txtProjectDir.Text, Properties.Settings.Default.OrigsDir), "*.tiff").Length == 0)
else if (Directory.GetFiles(Path.Combine(txtProjectDir.Text, Properties.Settings.Default.OrigsDir), "*.tif").Length == 0
&& Directory.GetFiles(Path.Combine(txtProjectDir.Text, Properties.Settings.Default.OrigsDir), "*.tiff").Length == 0
&& Directory.GetFiles(Path.Combine(txtProjectDir.Text, Properties.Settings.Default.OrigsDir), "*.png").Length == 0)
{
MessageBox.Show("Origs files not found.", "Error no TIF files found.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
@ -331,6 +333,7 @@ namespace PDFWorkflowManager
}
if (Directory.Exists(Path.Combine(txtProjectDir.Text, Properties.Settings.Default.WorkOutDir)))
{
try
@ -353,6 +356,7 @@ namespace PDFWorkflowManager
}
}
if (File.Exists(txtProjectDir.Text + @"\run_simplex_sorting_script.txt"))
{
checkSimplex.Checked = true;
@ -428,6 +432,13 @@ namespace PDFWorkflowManager
string[] strFiles = Directory.GetFiles(origsDir, "*.tif");
int sourceFileCount = strFiles.Length;
if (sourceFileCount == 0)
{
strFiles = Directory.GetFiles(origsDir, "*.png");
sourceFileCount = strFiles.Length;
}
int odd = 1;
int even = sourceFileCount;
Directory.CreateDirectory(workDir);