[reportlab-users] Problem on Mac OSX
    Y Tu 
    ytu888 at hotmail.com
       
    Mon Oct  1 09:45:04 EDT 2007
    
    
  
I installed PIL and ReportLab on Mac OS X. The test-run with command "from PIL import Image" followed by "import _imaging", and  "from reportlab.graphics import renderPDF" succeeded. However, when I run the test script (eportlab/test/test_pdfgen_general.py) coming with the package, I got the following error. How to fix the problem. Another question is how to run the script under the python prompt (>>>) after importing the scirpt by "import test_pdfgen_general.py". Thank yuo very much.
nypivs-lee:/Applications/MacPython 2.5/reportlab/test lee$ python test_pdfgen_general.py
E
======================================================================
ERROR: Make a PDFgen document with most graphics features
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_pdfgen_general.py", line 833, in test0
    run(outputfile('test_pdfgen_general.pdf'))
  File "test_pdfgen_general.py", line 796, in run
    c = makeDocument(filename)
  File "test_pdfgen_general.py", line 725, in makeDocument
    c.drawImage(tgif, 4*inch, 9.25*inch, w, h, mask='auto')
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfgen/canvas.py", line 629, in drawImage
    imgObj = pdfdoc.PDFImageXObject(name, image, mask=mask)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py", line 1840, in __init__
    self.loadImageFromA85(src)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py", line 1846, in loadImageFromA85
    imagedata = map(string.strip,pdfutils.makeA85Image(source,IMG=IMG))
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfbase/pdfutils.py", line 35, in makeA85Image
    raw = img.getRGBData()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/lib/utils.py", line 612, in getRGBData
    self._data = im.tostring()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/Image.py", line 513, in tostring
    self.load()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/ImageFile.py", line 180, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/Image.py", line 375, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available
----------------------------------------------------------------------
Ran 1 test in 0.321s
FAILED (errors=1)
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071001/e7d0a4b1/attachment.html>
    
    
More information about the reportlab-users
mailing list