Questions tagged «identification»

11
如何检查文件是否为有效的图像文件?
我目前正在使用PIL。 from PIL import Image try: im=Image.open(filename) # do stuff except IOError: # filename not an image file 但是,尽管这足以涵盖大多数情况,但仍未检测到某些图像文件,例如xcf,svg和psd。Psd文件会引发OverflowError异常。 有办法我也可以包括它们吗?


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.