Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: Read file header if mime type can't be detected #325

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

drinkcat
Copy link

@drinkcat drinkcat commented Jul 3, 2024

If the mime type can't be detected using the extension alone, open the file and try again with a few bytes of header.

Allows for file type detection for .MP files that the Google Pixel phone generates.

Fixes #324.

lookupMimeType only uses the extension, but it can also
be provided with the first few bytes of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not recognize files that end in ".MP" as videos
1 participant