FileSignatures
FileSignatures copied to clipboard
Alternative extensions for formats (jpg, jpeg, ...)
Unfortunately, to my current understanding, some file extensions such as jpeg/jpg or tiff/tif have various alternative extensions. I need to validate that the file extension matches the mime type, but it is rather difficult, since this library does not take into consideration this alternative extension stuff.
Or, is it more complex than I think?
There is even a conflict in README and code
Yes, currently only a single extension is supported. I don't like to make breaking changes but it is incorrect so perhaps I should change it.
I would be tempted to keep the existing property so we don't break anyone's code but mark it as obsolete (for the duration of a major version) so we would have something like:
public IEnumerable<string> Extensions { get; }
[Obsolete("Use Extensions property instead")]
public string Extension { get; } => Extensions.First();
Would that solve your issue?
Yes, that sounds phenomenal, thank you.