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

consider mime crate to support more features easily... #26

Open
ultrasaurus opened this issue Jul 18, 2023 · 3 comments
Open

consider mime crate to support more features easily... #26

ultrasaurus opened this issue Jul 18, 2023 · 3 comments
Assignees

Comments

@ultrasaurus
Copy link
Owner

ultrasaurus commented Jul 18, 2023

We need to detect all the media types supported by EPUB, so considering using a crate which is maintained and well-tested, supporting:

  • detecting mime-type by extension
  • match on type (e.g. audio/video/image) as well as sub-type
  • structured type with easy-to-use string conversion (e.g. display, debug, etc)

Options:

  • mime
  • new_mime_guess
    • has code to support markdown + m4a mapping seems correct at first glance
  • mime_typed
    • more complete set of mime types than the "mime" crate
    • optional support for mime compatibility
  • mediatype
    • zero copy MediaType or owned MediaTypeBuf
    • optional: serde support
@ultrasaurus
Copy link
Owner Author

I'm not fond of Mime crate

  • lacks support of markdown mime type!
  • lots of fair critiques in the issues

However, its maintainers make what seem to be good arguments about the hyper use case which lead to a bunch of the design decisions that some folks dislike, and different crates are making different tradeoffs

I don't understand our use case well enough, so just went with Mime to learn about it and will leave as is until I get a bit more experience with what is needed.

Closing for now, since PR merged that uses Mime. Feel free to re-open if there are any compelling arguments to use a different crate!

@ultrasaurus
Copy link
Owner Author

note: mime_guess doesn't do the right thing for .m4a files, abonander/mime_guess#88

@ultrasaurus
Copy link
Owner Author

ultrasaurus commented Apr 1, 2024

could also consider https://github.com/Lynnesbian/new_mime_guess (fork of mime_guess)

added to list in issues description with notes

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

No branches or pull requests

1 participant