How to guess image mime type?

后端 未结 3 713
感动是毒
感动是毒 2020-12-11 06:41

How can I guess an image\'s mime type, in a cross-platform manner, and without any external libraries?

3条回答
  •  心在旅途
    2020-12-11 07:33

    If you know in advance that you only need to handle a limited number of file formats you can use the imghdr.what function.

提交回复
热议问题