Giter Site home page Giter Site logo

Comments (4)

DatL4g avatar DatL4g commented on May 25, 2024

Which MIME type is it reporting? And which method did you use?

from mimemagic-android.

Cyberavater avatar Cyberavater commented on May 25, 2024

mimeType: audio/x-wav

fromFile(path.toFile()).mimeType

from mimemagic-android.

Cyberavater avatar Cyberavater commented on May 25, 2024

You can also download this image to check, apparently the github doesn't compress the image (verified by hash).

from mimemagic-android.

DatL4g avatar DatL4g commented on May 25, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.