比如有d变量保存了post到服务器的二进制图片, 服务器需要检测是否为图片以及图片类型
除了使用magic库以外 还有什么办法? 比如用mimetypes?
除了使用magic库以外 还有什么办法? 比如用mimetypes?

1 Livid MOD PRO man file |
2 cute Jan 6, 2013 import imghdr imgtype = imghdr.what('/tmp/bass.gif') imgtype = imghdr.what(None, data) |
3 luztak Jan 6, 2013 89 50 4e 47 0d 0a 1a 0a png文件头 这两天看这个看得头疼 |
5 yemoluo Jan 6, 2013 |