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
This makes it sort of a pain because file uploads don't have extensions. They look something like /var/folders/fm/vyvfk53d2b5gf63m7dnv3gqc0000gn/T/33ba4e6ef6ded7f0369f587f17090af4. So, to get around this, I have to rename it to the name it was uploaded as before giving it to lwip. I believe you should be able to use something like: https://github.com/rosszurowski/mime-sniffer/ and read it based on the actual file type, not the extension of the file.
The text was updated successfully, but these errors were encountered:
Detecting mime types is not in the scope of lwip.
It's very application-specific. Not all apps will use lwip to process images uploaded to a web server.
You could use the module you suggested to detect the type of image uploaded to your server, and thus give lwip the correct type when opening the file.
What lwip could do, is detect the image type automatically (unrelated to mime types). And indeed there's an issue for this (#87), and a PR (#96). It will be available in the next version.
This makes it sort of a pain because file uploads don't have extensions. They look something like
/var/folders/fm/vyvfk53d2b5gf63m7dnv3gqc0000gn/T/33ba4e6ef6ded7f0369f587f17090af4
. So, to get around this, I have to rename it to the name it was uploaded as before giving it to lwip. I believe you should be able to use something like: https://github.com/rosszurowski/mime-sniffer/ and read it based on the actual file type, not the extension of the file.The text was updated successfully, but these errors were encountered: