For example, this is a webp image, download it to test.webp:
This is the difference between puremagic and magic:
In [22]: import puremagic
In [23]: puremagic.from_file("test.webp", mime=True)
Out[23]: ''
In [24]: import magic
In [25]: magic.from_file("test.webp", mime=True)
Out[25]: 'image/webp'
It is seems that mime is missing, but if I remove the mime=True. I can get the webp extension:
In [26]: puremagic.from_file("test.webp")
Out[26]: '.webp'
For example, this is a webp image, download it to
test.webp
:This is the difference between puremagic and magic:
It is seems that mime is missing, but if I remove the
mime=True
. I can get the webp extension: