0
我已成功在我的盒式磁带(Python 2.7)中安装了PIL和reportlab,并通过控制台中的ssh测试了它们。Openshift reportlab PIL问题
不知何故,reportlab不能使用PIL。
我也尝试下载PIL并修复了64位问题,但我仍然得到错误。
这消息我得到:
unpack requires a string argument of length 1
Imaging Library not available, unable to import bitmaps only jpegs
fileName='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png' identity=[[email protected] filename='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png']
fileName='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png' identity=[[email protected] filename='/var/lib/openshift/52c1ab8de0b8cdb8a1000177/app-root/runtime/repo/wsgi/static/images/logo_colegio.png']
我抬起头的代码,发现这是在异常应该抛出:
if haveImages:
#detect which library we are using and open the image
if not self._image:
self._image = self._read_image(self.fp)
if getattr(self._image,'format',None)=='JPEG':
self.jpeg_fh = self._jpeg_fh
else:
from reportlab.pdfbase.pdfutils import readJPEGInfo
try:
self._width,self._height,c=readJPEGInfo(self.fp)
except:
annotateException('\nImaging Library not available, unable to import
bitmaps only jpegs\nfileName=%r identity=%s'%(fileName, self.identity()))
它应该只提高,如果“haveImages”是假。奇怪的是,我用控制台打印reportlab.util.haveImage并得到“真”
我用尽想法...有没有人遇到过这样的情况? 任何想法将不胜感激!
PD:发生这种情况时,我尝试将图像添加到帧,使用addFromList()((鸭嘴兽))