public static FileFormat GetFileFormatNoUnknown(FilePath imageFilePath, IStringlyTypedPathOperator stringlyTypedPathOperator) { var fileFormat = ImageFileFormatOperator.GetFileFormatAllowUnknown(imageFilePath, stringlyTypedPathOperator); if (fileFormat == FileFormat.Unknown) { var fileExtension = stringlyTypedPathOperator.GetFileExtension(imageFilePath.Value); var message = EnumerationHelper.UnrecognizedEnumerationValueMessage <FileFormat>(fileExtension); throw new Exception(message); } return(fileFormat); }
public FileFormat GetFileFormat(FilePath imageFilePath) { var fileFormat = ImageFileFormatOperator.GetFileFormatNoUnknown(imageFilePath, this.StringlyTypedPathOperator); return(fileFormat); }
public string GetFileExtension(FileFormat fileFormat) { var fileExtension = ImageFileFormatOperator.GetFileExtensionNoUnknown(fileFormat); return(fileExtension); }