CSharpImageLibrary.ImageFormats.IsExtensionSupported C# (CSharp) Method

IsExtensionSupported() public static method

Determines if file has a supported extension.
public static IsExtensionSupported ( string filePath, List supported = null ) : bool
filePath string Path of file to to check.
supported List Optionally list of supported extensions. Good if looping and can initialise supported and pass into this every loop.
return bool
        public static bool IsExtensionSupported(string filePath, List<string> supported = null)
        {
            List<string> supportedExts = supported ?? GetSupportedExtensions(true);
            return supportedExts.Contains(Path.GetExtension(filePath), StringComparison.OrdinalIgnoreCase);
        }