You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I want to say thank you for your hard work on this project! I'm transitioning my critical path code from h2non/filepath to mimetype due to your better support for MSO files. I did have a feature request though that would make my life much easier, and I'm assuming others as well:
filetype has a few really nice aggregate functions that tell you if a file is a document, compressed, image, etc. Here's an example. I think with the tree structure you have, you could even make this dynamic by constructing the tree with something like namespaces. Or you could simply have a manual list of all the file types you support. Or even have a tag field on your structure.
There's lots of options, but generally I'd love to see the ability to ask mimetype if a file is of a compressed type without having to hard-code a list of mimetypes that are compressed.
Something like:
mt:=mimetype.Detect(buffer)
ifmt.IsCompressed() {
// Do something
} elseifmt.IsImage() {
// Do something else
}
The text was updated successfully, but these errors were encountered:
First off, I want to say thank you for your hard work on this project! I'm transitioning my critical path code from
h2non/filepath
tomimetype
due to your better support for MSO files. I did have a feature request though that would make my life much easier, and I'm assuming others as well:filetype
has a few really nice aggregate functions that tell you if a file is a document, compressed, image, etc. Here's an example. I think with the tree structure you have, you could even make this dynamic by constructing the tree with something like namespaces. Or you could simply have a manual list of all the file types you support. Or even have atag
field on your structure.There's lots of options, but generally I'd love to see the ability to ask mimetype if a file is of a compressed type without having to hard-code a list of mimetypes that are compressed.
Something like:
The text was updated successfully, but these errors were encountered: