ahupp / python-magic

A python wrapper for libmagic
Other
2.6k stars 281 forks source link

x-portable-bitmap file type #198

Closed larytet closed 4 years ago

larytet commented 4 years ago

magic.from_buffer(b'P1 - Mobile Touch - Europe + Australia', mime=True) returns image/x-portable-bitmap

ahupp commented 4 years ago

A portable bitmap file is a text file starting with P1: https://en.wikipedia.org/wiki/Netpbm_format You can see this behavior in the file command:

ahupp@LAPTOP-KQ5N2P8K:~$ echo 'P1 - Mobile Touch - Europe + Australia' > test.txt
ahupp@LAPTOP-KQ5N2P8K:~$ file --mime-type test.txt
test.txt: image/x-portable-bitmap

If this is really problematic I'd suggest reporting to the libmagic maintainers.

larytet commented 4 years ago

In this case libmagic could check the content more carefully. For example, see that the data starts with P1 following by a bitmap. What is the best way to report an issue in libmagic?

ahupp commented 4 years ago

I believe you can report bugs here:

https://bugs.astron.com/my_view_page.php