Wow, do I ever owe you. Hopefully our paths will cross someday and I can buy you a beer! Thanks much, really appreciated.
-Jim On Wed, Oct 24, 2012 at 2:06 PM, Niphlod <[email protected]> wrote: > ok, got a new answer for you. apparently, it's a pretty common error on > win. > > http://stackoverflow.com/questions/5352968/trouble-using-pil-in-django-app-on-windows > Seems that on mod_wsgi you need a precompiled build of PIL > > On Wednesday, October 24, 2012 6:33:33 PM UTC+2, Jim S wrote: > >> Both are showing the same version. >> >> 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] >> >> -Jim >> >> On Wed, Oct 24, 2012 at 10:30 AM, Niphlod <[email protected]> wrote: >> >>> import sys >>> print sys.version >>> >>> ? >>> >>> >>> On Wednesday, October 24, 2012 4:47:06 PM UTC+2, Jim S wrote: >>> >>>> No, I'm not sure. How could I tell? >>>> >>>> -Jim >>>> >>>> On Wed, Oct 24, 2012 at 9:45 AM, Niphlod <[email protected]> wrote: >>>> >>>>> your exception points to >>>>> http://effbot.org/zone/pil-imaging-not-installed.htm >>>>> >>>>> are you sure that apache and shell version of python are the same and >>>>> can reach the same modules ? >>>>> >>>>> >>>>> On Wednesday, October 24, 2012 4:36:09 PM UTC+2, Jim S wrote: >>>>>> >>>>>> I have a rather strange problem. >>>>>> >>>>>> On my production server I'm running apache and mod_wsgi. >>>>>> >>>>>> I have reports that I generate using reportlab. In some of the >>>>>> reports I display a corporate logo which is stored in a .png file. >>>>>> >>>>>> If I start web2py from the command line (using the rocket server) my >>>>>> reports work fine. When I run them through apache and mod_wsgi I get the >>>>>> following: >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File "C:\prod\web2py\gluon\restricted.py", line 212, in restricted >>>>>> exec ccode in environment >>>>>> File "C:\prod\web2py\applications\infocenter\controllers/reports.py" >>>>>> , line 179, in <module> >>>>>> File "C:\prod\web2py\gluon\globals.py", line 188, in <lambda> >>>>>> self._caller = lambda f: f() >>>>>> File "C:\prod\web2py\gluon\tools.py", line 2911, in f >>>>>> return action(*a, **b) >>>>>> File "C:\prod\web2py\applications\infocenter\controllers/reports.py" >>>>>> , line 46, in corporateList >>>>>> rpt.corporateList(letters_file, auth.user.id) >>>>>> File "applications\infocenter\modules\reports\corporateList.py",line >>>>>> 245, in corporateList >>>>>> go(doc, db) >>>>>> File "applications\infocenter\modules\reports\corporateList.py",line >>>>>> 228, in go >>>>>> doc.build(reportStory, onFirstPage=firstPage, onLaterPages= >>>>>> subsequentPages) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 1117, in build >>>>>> BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 877, in build >>>>>> self.clean_hanging() >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 510, in clean_hanging >>>>>> self.handle_flowable(self._hanging) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 757, in handle_flowable >>>>>> f.apply(self) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 140, in apply >>>>>> getattr(doc,arn)(*args) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 1093, in handle_pageBegin >>>>>> self._handle_pageBegin() >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\platypus\doctemplate.py" >>>>>> , line 535, in handle_pageBegin >>>>>> self.pageTemplate.onPage(self.canv,self) >>>>>> File "applications\infocenter\modules\reports\corporateList.py",line >>>>>> 91, in firstPage >>>>>> PAGE_HEIGHT-(1.15*inch), 55, 55) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\pdfgen\canvas.py" >>>>>> , line 857, in drawImage >>>>>> imgObj = pdfdoc.PDFImageXObject(name, image, mask=mask) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\pdfbase\pdfdoc.py" >>>>>> , line 2094, in __init__ >>>>>> self.loadImageFromA85(src) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\pdfbase\pdfdoc.py" >>>>>> , line 2100, in loadImageFromA85 >>>>>> imagedata = map(string.strip,pdfutils.makeA85Image(source,IMG=IMG)) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\pdfbase\pdfutils.py" >>>>>> , line 34, in makeA85Image >>>>>> raw = img.getRGBData() >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\lib\utils.py" >>>>>> , line 658, in getRGBData >>>>>> annotateException('\nidentity=%s'%self.identity()) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\reportlab-2.5-py2.7-win32.egg\reportlab\lib\utils.py" >>>>>> , line 653, in getRGBData >>>>>> im = im.convert('RGB') >>>>>> File >>>>>> "C:\Python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg\Image.py",line >>>>>> 679, in convert >>>>>> self.load() >>>>>> File >>>>>> "C:\Python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg\ImageFile.py" >>>>>> , line 164, in load >>>>>> self.load_prepare() >>>>>> File "C:\Python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg >>>>>> \PngImagePlugin.py", line 381, in load_prepare >>>>>> ImageFile.ImageFile.load_prepare(self) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg\ImageFile.py" >>>>>> , line 231, in load_prepare >>>>>> self.im = Image.core.new(self.mode, self.size) >>>>>> File >>>>>> "C:\Python27\lib\site-packages\pil-1.1.7-py2.7-win32.egg\Image.py",line >>>>>> 37, in __getattr__ >>>>>> raise ImportError("The _imaging C module is not installed") >>>>>> ImportError: The _imaging C module is not installed >>>>>> identity=[ImageReader@0x2b5aa50 filename= >>>>>> 'c:/prod/web2py/applications/InfoCenter/static/images/logo.png'] >>>>>> handle_pageBegin args=() >>>>>> >>>>>> >>>>>> Any idea why this is happening? I'm thinking it has something to do >>>>>> with the full path of the image file being specified here in the log. >>>>>> Ideas? >>>>>> >>>>>> -Jim >>>>>> >>>>> -- >>>>> >>>>> >>>>> >>>>> >>>> >>>> -- >>> >>> >>> >>> >> >> -- > > > > --

