Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect mime providing headerBytes #65

Open
phath9 opened this issue Jun 13, 2022 · 1 comment
Open

Incorrect mime providing headerBytes #65

phath9 opened this issue Jun 13, 2022 · 1 comment

Comments

@phath9
Copy link

phath9 commented Jun 13, 2022

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
@mx1up
Copy link

mx1up commented Feb 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants