0

PIL と reportlab の両方をカートリッジ (Python 2.7) に正常にインストールし、コンソールで ssh を介して両方をテストしました。

どういうわけか、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=[ImageReader@0x7f6206c29c10 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=[ImageReader@0x7f6206c29c10 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」が False の場合にのみ発生します。奇妙なことに、コンソールを使用して reportlab.util.haveImage を出力し、「True」を取得しました。

私はアイデアが不足しています.このような状況に遭遇した人はいますか? どんなアイデアでも大歓迎です!!

PD: これは、addFromList() ((カモノハシ)) を使用して、フレームに画像を追加しようとすると発生します。

4

1 に答える 1