You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the magic_number.dart, the magic bytes of JPEG file is [0xFF, 0xD8].
So, calling lookupMimeType('file.jpeg', headerBytes: [0x89]) should have returned FALSE, instead of TRUE.
I'm passing header bytes explicitly, so the match must fail if the header bytes don't match with the magic bytes.
The text was updated successfully, but these errors were encountered:
rastogitech
changed the title
lookupMimeType() with magic bytes (file signature) is buggy
lookupMimeType() with magic bytes/file signature is buggy
Jun 1, 2024
rastogitech
changed the title
lookupMimeType() with magic bytes/file signature is buggy
lookupMimeType(path, headerBytes) returning TRUE on passing incorrect headerBytes as well
Jun 1, 2024
Action:
lookupMimeType('file.jpeg', headerBytes: [0x89])
Expected behaviour:
FALSE
Actual result:
TRUE
Description:
magic_number.dart
, the magic bytes ofJPEG
file is[0xFF, 0xD8]
.lookupMimeType('file.jpeg', headerBytes: [0x89])
should have returned FALSE, instead of TRUE.The text was updated successfully, but these errors were encountered: