繁体   English   中英

python PIL image.open()错误

[英]python PIL image.open() error

你好,我正在使用PIL打开图像,但是有这样的错误; 追溯(最近一次通话):

  File "/Users/minsw0810gmail.com/Desktop/GUIAccidentAlarm.py", line 
142, in <module>
   filename1 = Image.open('횡단보도상_100x100.jpg', "rb")
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/PIL/Image.py", line 2462, in open
    raise ValueError("bad mode %r" % mode)
ValueError: bad mode 'rb'
[Finished in 0.8s with exit code 1]
[shell_cmd: python -u 
"/Users/minsw0810gmail.com/Desktop/GUIAccidentAlarm.py"]
[dir: /Users/minsw0810gmail.com/Desktop]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

*횡단보도상_100x100.jpg是韩文,我的代码是

filename1 = Image.open('횡단보도상_100x100.jpg')

Image.open()仅支持将“ r”作为模式参数,并为其他所有内容引发异常。

这是文档关于此参数的说明:

模式–模式。 如果给定,则此参数必须为“ r”。

有关更多信息,请参见以下链接:

http://pillow.readthedocs.io/zh-CN/3.4.x/reference/Image.html#PIL.Image.open

希望对您有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM