Python初学者问题。下面的代码应该解释我的问题:
import Image
resolution = (200,500)
scaler = "Image.ANTIALIAS"
im = Image.open("/home/user/Photos/DSC00320.JPG")
im.resize(resolution , scaler)
结果:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1255, in resize
raise ValueError("unknown resampling filter")
ValueError: unknown resampling filter
这个有效:
im.resize(resolution , Image.ANTIALIAS)