catch IO error

This commit is contained in:
j 2010-09-19 19:32:16 +02:00
parent 23ab4260ed
commit 1ef514ef4c
1 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,8 @@ class PosterCache(models.Model):
if self.image:
try:
self.image.width
except IOError:
self.image.delete()
except TypeError:
self.failed = True
self.status = "invalid image"