using System.Collections.Generic; using System.IO; namespace ZeroLevel.ML { /// /// Форматы изображений /// public static class KnownImageFormats { private static HashSet _formats = new HashSet() { ".bmp", ".jpeg", ".jpg", ".png", ".tiff", ".webp" }; /// /// Проверка, является ли файл обрабатываемым приложением как изображение /// public static bool IsKnownFormat(string filePath) { var ext = Path.GetExtension(filePath)?.ToLowerInvariant(); if (string.IsNullOrWhiteSpace(ext)) return false; return _formats.Contains(ext); } } }