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?