#4478: PIL Bug Causes Django 0.96 Image Validator to Break if OLE Document
Uploaded
------------------------------+---------------------------------------------
Reporter:  [EMAIL PROTECTED]  |       Owner:  adrian         
  Status:  new                |   Component:  Validators     
 Version:  0.96               |    Keywords:  image validator
   Stage:  Unreviewed         |   Has_patch:  0              
------------------------------+---------------------------------------------
 My first test was to upload a valid image. Worked fine.
 My next few tests were to upload invalid files: pdf, vb, xml, txt,
 etc.
 The result was a nice error message except when I tried to upload any
 kind of MS Office file. This broke Django...
 
 -----------------------
 Traceback (most recent call last):
 File "C:\Python24\Lib\site-packages\django\core\handlers\base.py" in
 get_response
   77. response = callback(request, *callback_args, **callback_kwargs)
 File "C:\Python24\Lib\site-packages\django\contrib\auth\decorators.py"
 in _checklogin
   14. return view_func(request, *args, **kwargs)
 File "c:\idms_project\idms\ssi\views.py" in update_ssi_status
   121. errors = manipulator.get_validation_errors(new_data)
 File "C:\Python24\Lib\site-packages\django\oldforms\__init__.py" in
 get_validation_errors
   59. errors.update(field.get_validation_errors(new_data))
 File "C:\Python24\Lib\site-packages\django\oldforms\__init__.py" in
 get_validation_errors
   362. self.run_validator(new_data, validator)
 File "C:\Python24\Lib\site-packages\django\oldforms\__init__.py" in
 run_validator
   352. validator(new_data.get(self.field_name, ''), new_data)
 File "C:\Python24\Lib\site-packages\django\oldforms\__init__.py" in
 isValidImage
   694. validators.isValidImage(field_data, all_data)
 File "C:\Python24\Lib\site-packages\django\core\validators.py" in
 isValidImage
   176. Image.open(StringIO(content))
 File "C:\Python24\lib\site-packages\PIL\Image.py" in open
   1730. return factory(fp, filename)
 File "C:\Python24\lib\site-packages\PIL\ImageFile.py" in __init__
   82. self._open()
 File "C:\Python24\lib\site-packages\PIL\FpxImagePlugin.py" in _open
   63. self.ole = OleFileIO(self.fp)
 File "C:\Python24\lib\site-packages\PIL\OleFileIO.py" in __init__
   260. self.open(filename)
 File "C:\Python24\lib\site-packages\PIL\OleFileIO.py" in open
   289. self.loadfat(header)
 File "C:\Python24\lib\site-packages\PIL\OleFileIO.py" in loadfat
   309. s = self.getsect(ix)
 File "C:\Python24\lib\site-packages\PIL\OleFileIO.py" in getsect
   324. self.fp.seek(512 + self.sectorsize * sect)
 
   OverflowError at /ssi/ssi_status/update/380/181/
   long int too large to convert to int
 -----------------------
 
 According to Chris Beaven, the problem is with PIL...
 -quote-
 It's a bug with PIL reading OLE files with Python 2.4:
 http://mail.python.org/pipermail/image-sig/2006-February/003764.html
 
 Probably worth filing a ticket - it'd be easy enough to catch
 OverflowError in our validator.
 -end quote-

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4478>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to