spambayes/spambayes ImageStripper.py, 1.14, 1.15

"Sjoerd Mullender" <[email protected]> Fri, 25 May 2007 01:18:23 -0700
Newsgroups gmane.mail.spam.spambayes.cvs
Message-ID <[email protected]>
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9617

Modified Files:
	ImageStripper.py 
Log Message:
We don't really care *why* opening/loading an image fails.  If the
operation fails, the image is invalid, as far as we are concerned.


Index: ImageStripper.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ImageStripper.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ImageStripper.py	26 Mar 2007 07:50:31 -0000	1.14
--- ImageStripper.py	25 May 2007 08:18:21 -0000	1.15
***************
*** 143,147 ****
              image = Image.open(StringIO.StringIO(bytes))
              image.load()
!         except IOError:
              tokens.add("invalid-image:%s" % part.get_content_type())
              continue
--- 143,149 ----
              image = Image.open(StringIO.StringIO(bytes))
              image.load()
!         except:
!             # Any error whatsoever is reason for not looking further at
!             # the image.
              tokens.add("invalid-image:%s" % part.get_content_type())
              continue