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

mime magic for extensionless files #99

Open
wants to merge 3 commits into
base: extensionless-filename
Choose a base branch
from

Conversation

apolkosnik-old
Copy link

This method actually uses the mime type to generate a list of possible extensions for the given mimetype, and tries them all. Obviously if one works, we get the results. I did run make all in tests, and it ran all the tests fine, I guess I'm missing a few test cases in travis-ci

@apolkosnik-old
Copy link
Author

Looks like I need to put some more thought into this, I like your table approach, so perhaps using a table might be a better approach here

@deanmalmgren
Copy link
Owner

Sorry I didn't get back to you sooner on this. What do you mean by "my table approach"?

@apolkosnik-old
Copy link
Author

IN the current incarnation of this, I'm getting back a list of typical extensions for the filetype, and I'm going through all of these, instead of doing that, perhaps it would be much better to just just fill in a lookup table and use it for the supported formats.

@deanmalmgren
Copy link
Owner

I just took a closer look at your branch and I see what you're talking about. I agree that it would be better to have a lookup table of supported formats that maps mimetype to file extension.

I'm going to add a couple of comments to your PR with a few things that I noticed but, assuming we can get this to play nicely with the rest of the package (meaning: the tests either pass or fail for known reasons, in which case we should fix the tests), this seems like a great thing to incorporate.

@cahya-wirawan
Copy link

Hi,
any progress with this functionality? I would like to convert a document directly from memory to text, otherwise I have first to save the document in memory to a file, and then convert it.
Thanks.

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.

3 participants