OSError:写入图像文件时编码器错误-2

时间:2019-03-14 20:27:54

标签: python python-3.x scipy data-science python-imageio

写入图像文件时出现以下错误:

imageio.imwrite(fname,g);
File "C:\Users\Himanshu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\imageio\core\functions.py", line 261, in imwrite
writer.append_data(im)
....
....
raise IOError("encoder error %d when writing image file" % s)
OSError: encoder error -2 when writing image file
我编写代码的

函数是:

def main():
for filename in os.listdir(path):
    ....
    ....
    g = numpy.reshape(a,(len(a)//width,width));
    g = numpy.uint8(g);
    fname = str(filename + '.jpg');
    imageio.imwrite(fname,g);

我是初学者,请帮忙。

0 个答案:

没有答案