This is a snapshot of Indico's old Trac site. Any information contained herein is most probably outdated. Access our new GitHub site here.

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#478 closed defect (fixed)

problem with PIL

Reported by: jbenito Owned by: lsyroka
Priority: very low Milestone: v0.97.0
Component: General Version: 0.97.0
Keywords: Cc:

Description

Error details

exception message => 'NoneType' object has no attribute 'bands'
exception type => exceptions.AttributeError
traceback => 
  File "/usr/lib/python2.4/site-packages/cds_indico-0.97_rc1-py2.4.egg/MaKaC/webinterface/rh/base.py", line 481, in process
    res = self._process()

  File "/usr/lib/python2.4/site-packages/cds_indico-0.97_rc1-py2.4.egg/MaKaC/webinterface/rh/contribDisplay.py", line 100, in _process
    data = pdf.getPDFBin()

  File "/usr/lib/python2.4/site-packages/cds_indico-0.97_rc1-py2.4.egg/MaKaC/PDFinterface/base.py", line 364, in getPDFBin
    self._doc.build(self._story, onFirstPage=self.firstPage, onLaterPages=self.laterPages)

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 1010, in build
    BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 774, in build
    self.clean_hanging()

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 412, in clean_hanging
    self.handle_flowable(self._hanging)

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 659, in handle_flowable
    f.apply(self)

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 118, in apply
    getattr(doc,arn)(*args)

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 986, in handle_pageBegin
    self._handle_pageBegin()

  File "/usr/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 437, in handle_pageBegin
    self.pageTemplate.onPage(self.canv,self)

  File "/usr/lib/python2.4/site-packages/cds_indico-0.97_rc1-py2.4.egg/MaKaC/PDFinterface/conference.py", line 708, in firstPage
    c.drawInlineImage(imagePath, self._PAGE_WIDTH/4.0 - width/2, self._PAGE_HEIGHT - inch - heigth)

  File "/usr/lib/python2.4/site-packages/reportlab/pdfgen/canvas.py", line 598, in drawInlineImage
    img_obj = PDFImage(image, x,y, width, height)

  File "/usr/lib/python2.4/site-packages/reportlab/pdfgen/pdfimages.py", line 41, in __init__
    self.getImageData()

  File "/usr/lib/python2.4/site-packages/reportlab/pdfgen/pdfimages.py", line 147, in getImageData
    imagedata, imgwidth, imgheight = self.non_jpg_imagedata(image)

  File "/usr/lib/python2.4/site-packages/reportlab/pdfgen/pdfimages.py", line 127, in non_jpg_imagedata
    imagedata = pdfutils.cacheImageFile(image,returnInMemory=1)

  File "/usr/lib/python2.4/site-packages/reportlab/pdfbase/pdfutils.py", line 64, in cacheImageFile
    code = makeA85Image(filename,IMG)

  File "/usr/lib/python2.4/site-packages/reportlab/pdfbase/pdfutils.py", line 34, in makeA85Image
    raw = img.getRGBData()

  File "/usr/lib/python2.4/site-packages/reportlab/lib/utils.py", line 651, in getRGBData
    self._dataA = ImageReader(im.split()[3])

  File "/usr/lib64/python2.4/site-packages/PIL/Image.py", line 1497, in split
    if self.im.bands == 1:

request handler => <class 'MaKaC.webinterface.rh.contribDisplay.RHContributionToPDF'>
url => http://indico.cern.ch/contributionDisplay.py/pdf?contribId=91&sessionId=14&confId=61310
parameters => 
contribId = 91
sessionId = 14
confId = 61310
headers => 
Host: indico.cern.ch
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://indico.cern.ch/contributionDisplay.py?contribId=91&amp;sessionId=14&amp;confId=61310

Change History (6)

comment:1 Changed 5 years ago by lsyroka

  • Owner set to lsyroka
  • Status changed from new to assigned

comment:2 Changed 5 years ago by lsyroka

Installing reportlab version 2.4 (reportlab-2.4-py2.4-linux-x86_64.egg) on production server should fix this bug.
Integrating ticket content will optimize image resizing.

comment:3 Changed 5 years ago by lsyroka

  • Status changed from assigned to in_merge

comment:4 Changed 5 years ago by lsyroka

Wiki updated

comment:5 Changed 5 years ago by Leszek Syroka <leszek.marek.syroka@…>

  • Resolution set to fixed
  • Status changed from in_merge to closed

In [5814b4ecdd79f93c072806e468ac6e5b55e49cf4]:

[FIX] Problems with PIL

  • installing reportlab version 2.4 (reportlab-2.4-py2.4-linux-x86_64.egg) on production server should fix this bug
  • image resizing optimized
  • fix#478

comment:6 Changed 5 years ago by Leszek Syroka <leszek.marek.syroka@…>

In [5814b4ecdd79f93c072806e468ac6e5b55e49cf4]:

[FIX] Problems with PIL

  • installing reportlab version 2.4 (reportlab-2.4-py2.4-linux-x86_64.egg) on production server should fix this bug
  • image resizing optimized
  • fix#478
Note: See TracTickets for help on using tickets.