簡體   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