Skip to content
New issue

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

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

Already on GitHub? # to your account

Detecting different non-plain text (text/*) mime-types. #14

Open
m00nwtchr opened this issue Oct 22, 2022 · 1 comment
Open

Detecting different non-plain text (text/*) mime-types. #14

m00nwtchr opened this issue Oct 22, 2022 · 1 comment

Comments

@m00nwtchr
Copy link

m00nwtchr commented Oct 22, 2022

I can see that this crate is focused on identifying files/arbitrary data by magic values, but afaict this is the only crate which implements the freedesktop shared mime db spec, so it would be nice if from_filepath also checked for matching extensions since most of the work (parsing the db etc.) is already done here, and would have to be duplicated in another crate.
Alternatively maybe some of that logic could be split out into another crate which then i could use to implement filename checking?

@m00nwtchr m00nwtchr changed the title Detection of plain-text formats without a magic value Detection of different plain-text formats Oct 22, 2022
@m00nwtchr m00nwtchr changed the title Detection of different plain-text formats Detection of different text/ mime-types Oct 22, 2022
@m00nwtchr m00nwtchr closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2022
@m00nwtchr m00nwtchr changed the title Detection of different text/ mime-types . Oct 22, 2022
@m00nwtchr m00nwtchr changed the title . Detecting different non-plain text (text/*) mime-types. Oct 22, 2022
@m00nwtchr m00nwtchr reopened this Oct 22, 2022
@mbrubeck
Copy link
Owner

This could be done using the “globs” files from the Shared MIME-info Database:

https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#idm45617682177472

I don’t have any plans to work on this, but would welcome contributions. For now, the mime_guess crate offers a similar feature.

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

No branches or pull requests

2 participants