Comments (4)
Which MIME type is it reporting? And which method did you use?
from mimemagic-android.
mimeType: audio/x-wav
fromFile(path.toFile()).mimeType
from mimemagic-android.
You can also download this image to check, apparently the github doesn't compress the image (verified by hash).
from mimemagic-android.
The image is a WebP which is a container format based on RIFF. This format is not fully supported by all devices and not even across all browsers, so they may detect different types.
Possible output types for this image are: audio/qcelp
, audio/x-wav
, image/webp
, video/x-msvideo
Since this library is just a wrapper of system provided functions and no self implementation by checking bytes, there is nothing I can do about it.
Every device could report different results for this, best you could do is a check if it's an image by using the fromUri
method and then check by the fromFile
method and if it's any of the above mentioned you know it's a WebP.
This however can be painful performance-wise and not very practical when you have a more generic use-case, like selecting any file and it could be any mime-type.
In this case I suggest you to use a library that's checking the type by bytes
from mimemagic-android.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mimemagic-android.