[英]Python PIL Image.save() error in case of EPS format
我正在嘗試將jpeg文件轉換為eps文件。 我正在使用以下代碼:
fp=open("test.jpg",'rb')
im=Image.open(fp)
outf=open('test2.eps','wb')
im.save(outf, 'EPS')
但是,我可能遇到以下錯誤:
Traceback (most recent call last):
File "im2eps2.py", line 11, in <module> im.save(outf, 'EPS')
File "C:\Python26\Lib\site-packages\PIL\Image.py", line 1465, in save
save_handler(self, fp, filename)
File "C:\Python26\Lib\site-packages\PIL\EpsImagePlugin.py", line 353, in _save
fp = io.TextIOWrapper(NoCloseStream(fp), encoding='latin-1')
File "C:\Python26\Lib\io.py", line 1429, in __init__
self._seekable = self._telling = self.buffer.seekable()
File "C:\Python26\Lib\site-packages\PIL\EpsImagePlugin.py", line 348, in __getattr__
return getattr(self.fp, name)
AttributeError: 'file' object has no attribute 'seekable'
我將感謝您的建議。 謝謝
PS:我從其主頁(即http://www.pythonware.com/products/pil/)重新安裝了PIL,並且可以正常工作:)之前,我使用了http://www.lfd.uci.edu/~提供的Windows安裝程序。 gohlke / pythonlibs 。 我認為問題出在我之前安裝的二進制文件上。 目前,我有1.1.7 PIL,並且工作正常。
謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.