我试过http://mail.python.org/pipermail/image-sig/2010-June/006313.html,但我仍然收到错误
dreampuf@HX:~/hub/lweibo$ python2.7 lweibo.py
Traceback (most recent call last):
File "lweibo.py", line 235, in <module>
lweibo_render(107906)
File "lweibo.py", line 228, in lweibo_render
p = LPic(a_body, a_title, a_ukey_nickname, a_ukey_img, a_create)
File "lweibo.py", line 114, in __init__
a_ukey_img.save("s.png", "PNG", qualty=100)
File "/Users/dreampuf/opt/macports/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pillow-1.7.7-py2.7-macosx-10.7-x86_64.egg/PIL/Image.py", line 1406, in save
self.load()
File "/Users/dreampuf/opt/macports/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pillow-1.7.7-py2.7-macosx-10.7-x86_64.egg/PIL/ImageFile.py", line 215, in load
raise_ioerror(e)
File "/Users/dreampuf/opt/macports/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pillow-1.7.7-py2.7-macosx-10.7-x86_64.egg/PIL/ImageFile.py", line 52, in raise_ioerror
raise IOError(message + " when reading image file")
IOError: broken data stream when reading image file
然后我尝试使用Macports安装jpeg6b,但它提醒我,jpeg6b版本太旧并重命名为jpeg
dreampuf@HX:~/lweibo$ sudo port install jpeg6b
Password:
---> Configuring jpeg6b
Error: jpeg6b has been renamed to jpeg. Please install jpeg instead.
Error: Target org.macports.configure returned: obsolete port
Log for jpeg6b is at: /Users/dreampuf/opt/macports/var/macports/logs/_Users_dreampuf_opt_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_jpeg6b/jpeg6b/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
但是jpeg的版本是8d。
dreampuf@HX:~/hub/lweibo$ port installed jpeg
The following ports are currently installed:
jpeg @8d_0 (active)
我知道这个错误的原因。但我无法在我的系统中安装 jpeg6b ,或者无法重新安装 PIL 以使用 jpeg6b。