You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've read #30, but I find that having do something like this (pardon the comments, direct copy-paste):
defis_mimetype_family(self, want_family):
our_type=filetype.guess(self.path)
ifour_typeisNone:
# sometimes, filetype fails horribly# # like with text files. works great for images thoughtype, encoding=mimetypes.guess_type(self.path)
iftypeisNone:
returnFalseifre.match(want_family, type) isnotNone:
returnTruereturnFalseifre.match(want_family, our_type.mime) isnotNone:
returnTruereturnFalse
It's a little counter-intuitive. Perhaps, you could utilize mimetypes as I have done.
I expected filetype to be a "one-stop shop" for mimetypes. Nevertheless, it is an excellent library for detecting mimetypes.
The text was updated successfully, but these errors were encountered:
I've read #30, but I find that having do something like this (pardon the comments, direct copy-paste):
It's a little counter-intuitive. Perhaps, you could utilize
mimetypes
as I have done.I expected filetype to be a "one-stop shop" for mimetypes. Nevertheless, it is an excellent library for detecting mimetypes.
The text was updated successfully, but these errors were encountered: