首页 Python python开发_imghdr_图像格式支持

python开发_imghdr_图像格式支持

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:\test\hongten.jpg], the type :[jpeg]

本文来自网络,不代表青岛站长网立场。转载请注明出处: https://www.0532zz.com/html/kaifa/python/20200716/6296.html
上一篇
下一篇

作者: dawei

【声明】:青岛站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

【免责声明】本站内容转载自互联网,其发布内容言论不代表本站观点,如果其链接、内容的侵犯您的权益,烦请提交相关链接至邮箱xwei067@foxmail.com我们将及时予以处理。

Copygight © 2016-2023 https://www.0532zz.com All Rights Reserved.青岛站长网

站长:xwei067#foxmail.com(请把#换成@)