Richard Ash <[email protected]> writes: > > Working on this I also hit a bug in PIL 1.1.7 which causes any page with an > image on it to be rendered as plain text (and no images). mw-render.log > contains tracebacks like > 2010-02-19T09:37:57 rlwriter.error >> Traceback (most recent call last): > File "/usr/lib/python2.6/site-packages/mwlib/rl/rlwriter.py", line 387, in > art > icleRenderingOK > testdoc.build(elements) > [...] > File > "/usr/lib/python2.6/site-packages/mwlib/ext/reportlab/pdfgen/canvas.py", > line 794, in drawImage > rawdata = image.getRGBData() > File "/usr/lib/python2.6/site-packages/mwlib/ext/reportlab/lib/utils.py", > line > 664, in getRGBData > self._dataA = ImageReader(im.split()[3]) > File "/usr/lib/python2.6/site-packages/PIL/Image.py", line 1497, in split > if self.im.bands == 1: > AttributeError: 'NoneType' object has no attribute 'bands' > > The problem is that PIL should load the image before trying to access the > number of bands, but doesn't. This is known upstream (there is a debian bug > against PIL), to work around it you just need to do the load() explicitly > before trying to access the number of bands. >
Many thanks for looking into this and providing a patch. I've applied it to mwlib.ext in http://code.pediapress.com/git/?p=mwlib.ext/.git;a=commit;h=d5823791b35f6df5fb182b80130be1fb7a17695a and also uploaded a new version to pypi (http://pypi.python.org/pypi/mwlib.ext/0.12.3) Regards, - Ralf -- You received this message because you are subscribed to the Google Groups "mwlib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/mwlib?hl=en.
