﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4478	[patch] PIL Bug Causes Django 0.96 Image Validator to Break if OLE Document Uploaded	pchilds@…	nobody	"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-


"		closed	Validators	0.96		fixed	image validator	v.oostveen@…	Design decision needed	1	0	0	0	0	0
