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

Use python-magic for filetype determination #90

Open
philb61 opened this issue Jan 13, 2016 · 0 comments
Open

Use python-magic for filetype determination #90

philb61 opened this issue Jan 13, 2016 · 0 comments
Labels

Comments

@philb61
Copy link
Contributor

philb61 commented Jan 13, 2016

Right now, we use a variation of what the original SunOS magic file had in it to deternine the filetype of a submission. This works, somewhat, but is ugly. For example, we recently had a pull request because images with EXIF data (so, pretty much anything taken with a modern phone or digital camera) weren't detected as JPEG based on the old magic file.

There is python-magic which will use the libmagic C library to return the correct filetype or MIME type if needed. To use it, we need to refactor our allowed filetypes, as we returned much simpler strings back than what libmagic does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant