mime icon indicating copy to clipboard operation
mime copied to clipboard

Incorrect mime providing headerBytes

Open phath9 opened this issue 3 years ago • 1 comments

Steps to reproduce:

  1. Get a sample PNG file: https://upload.wikimedia.org/wikipedia/sco/a/aa/Bart_Simpson_200px.png
  2. Use lookupMimeType method: lookupMimeType('Bart_Simpson_200px.png', headerBytes: [0xFF, 0xD8]);
  3. It returns image/jpeg when expected result should be image/png

phath9 avatar Jun 13 '22 05:06 phath9

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

mx1up avatar Feb 14 '23 10:02 mx1up