crop不能识别元组了,求助
系统是ubuntu22.04LTS,默认是python3.10,但因为3.10貌似不支持ddddocr,所以新装了3.9,用update--alternatives管理版本改了版本后,不能使用PIL,所以重新安装了PILLOW,现在的pillow版本是9.2
现在的代码出现了问题,也不知道为啥,请大神帮忙看下
photo=photo.crop((left,top,right,bottom))报错
提示如下
Traceback (most recent call last):
File "/home/lvguangmin/.local/lib/python3.9/site-packages/PIL/Image.py", line 2298, in save
format = EXTENSION
KeyError: ''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/lvguangmin/桌面/11/2.py", line 104, in <module>
photo.save('yanzhengma')
File "/home/lvguangmin/.local/lib/python3.9/site-packages/PIL/Image.py", line 2300, in save
raise ValueError(f"unknown file extension: {ext}") from e
ValueError: unknown file extension: 未知文件扩展名,给photo.save里的文件名加个字符串
页:
[1]