From: Daniel Martí Date: Fri, 24 Jan 2014 11:55:43 +0000 (+0100) Subject: Avoid more possible crashes when invalid icons are present X-Git-Tag: 0.2~372^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f277ba6b334177202e5560b69ee4818332e31e71;p=fdroidserver.git Avoid more possible crashes when invalid icons are present --- diff --git a/fdroidserver/update.py b/fdroidserver/update.py index b71d9782..bf3eed32 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -532,7 +532,12 @@ def scan_apks(apps, apkcache, repodir, knownapks): get_icon_dir(repodir, last_density), iconfilename) iconpath = os.path.join( get_icon_dir(repodir, density), iconfilename) - im = Image.open(last_iconpath) + try: + im = Image.open(last_iconpath) + except: + print "WARNING: Invalid image file at %s" % last_iconpath + continue + size = dpi_to_px(density) im.thumbnail((size, size), Image.ANTIALIAS)