FileSignatures icon indicating copy to clipboard operation
FileSignatures copied to clipboard

Alternative extensions for formats (jpg, jpeg, ...)

Open drozdik-m opened this issue 1 year ago • 3 comments

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?

drozdik-m avatar Oct 24 '23 12:10 drozdik-m

There is even a conflict in README and code

image

image

drozdik-m avatar Oct 24 '23 12:10 drozdik-m

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?

neilharvey avatar Oct 24 '23 19:10 neilharvey

Yes, that sounds phenomenal, thank you.

drozdik-m avatar Oct 24 '23 20:10 drozdik-m