Closed larytet closed 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.
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?
I believe you can report bugs here:
magic.from_buffer(b'P1 - Mobile Touch - Europe + Australia', mime=True)
returns image/x-portable-bitmap