mime
mime copied to clipboard
Incorrect mime providing headerBytes
Steps to reproduce:
- Get a sample PNG file: https://upload.wikimedia.org/wikipedia/sco/a/aa/Bart_Simpson_200px.png
- Use lookupMimeType method:
lookupMimeType('Bart_Simpson_200px.png', headerBytes: [0xFF, 0xD8]); - It returns
image/jpegwhen expected result should beimage/png
if you want to pass header bytes, they should be coming from the file itself.
in your sample code, you passed hard coded header bytes which would be matching a jpeg, so it's logical it returns image/jpeg