python PIL, 错误:IndexError: string index out of range

来源:互联网 发布:美国文献数据库 编辑:程序博客网 时间:2024/05/17 09:18


   用 python 的 PIL 库处理图片,并用 multiprocessing 库做并行计算

   运行后报错: IndexError: string index out of range


   写了各种函数,debug太烦。 一直以为是代码的问题。

   最后发现是因为有几幅图损坏, 导致运行 temp = image.split() 时报错。 

   加上 try 后就好了  

0 0