python开发_imghdr_图像格式支持
发布时间:2020-07-16 08:11:13 所属栏目:Python 来源:互联网
导读:python开发_imghdr_图像格式支持
在python中,模块对图像格式提供了支持 该模块主要是处理识别图像的格式 模块提供的函数如下: imghdr.what(filename,h= Tests the image data contained the file named by filename, returns a string describing the image type. If optional h provided,t he filename ignored h assumed to contain the byte stream to test. A list of functions performing the individual tests. Each function takes two arguments: the byte-stream an open file-like object. When what() called with a byte-stream,the file- The test function should a string describing the image type the test succeeded, None it failed.
IMG_PATH = = [ ( IMG_PATH = img_ext = ( == main() 运行效果: the image : [C:testhongten.jpg], the type :[jpeg]
(编辑:大庆站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |