sjakur / django-project-management

Automatically exported from code.google.com/p/django-project-management
0 stars 0 forks source link

Report generator crashes when an uploaded logo contains transparency #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The report generator crashes when an uploaded logo contains transparency 
(sample img: http://www.comune.trento.it/immagini/logo_orizzontale.gif)

AttributeError at /Files/0036/PID/

'NoneType' object has no attribute 'data'

Request Method:     GET
Request URL:    http://pgis.fem-environment.eu/Files/0036/PID/
Exception Type:     AttributeError
Exception Value:    'NoneType' object has no attribute 'data'

Crash in line 336:

/srv/software/dpm/trunk/django-project-management/sx/pisa3/pisa_reportlab.py in 
getTransparent

 329. else:
 330. if self._image.info.has_key("transparency"):
 331. transparency = self._image.info["transparency"] * 3
 332. palette = self._image.palette
 333. try:
 334. palette = palette.palette
 335. except:
 336. palette = palette.data
 337. return map(ord, palette[transparency:transparency + 3])
 338. else:
 339. return None
 340.
 341. def __str__(self):
 342. global _ctr 

Original issue reported on code.google.com by neteler.eden on 20 Oct 2010 at 4:16