Skip to content

Commit

Permalink
✏️ Ignore unkown files
Browse files Browse the repository at this point in the history
  • Loading branch information
kuleshov-aleksei committed Nov 11, 2023
1 parent 28b73bc commit 9d20322
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Watermarker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public partial class MainWindow : Window
[Notify] private string _progress;
[Notify] private string _copyTo;

private readonly List<string> m_knownExtensions = new List<string>()
{
".png", ".jpg", ".jpeg", ".bmp", ".tiff", ".tga", ".gif", ".webp"
};

public MainWindow(string[] args)
{
InitializeComponent();
Expand All @@ -47,6 +52,10 @@ private async void OnLoaded(object sender, RoutedEventArgs e)
Environment.Exit(1);
}

files = files
.Where(x => m_knownExtensions.Contains(Path.GetExtension(x).ToLowerInvariant()))
.ToList();

m_logger.Info($"Found {files.Count} files");
Status = $"Processing {files.Count} files";
ImageProcessorProgressBar.Minimum = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Watermarker/Watermarker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<UseWPF>true</UseWPF>
<Platforms>AnyCPU;x64</Platforms>
<ApplicationIcon>Assets\icon-72x72.ico</ApplicationIcon>
<Version>1.1.6</Version>
<Version>1.2.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 9d20322

Please sign in to comment.