From: Greg Darke Date: Sun, 15 Mar 2009 01:28:36 +0000 (+1100) Subject: Check that the input filename exists before attempting to convert it's format. X-Git-Url: https://code.delx.au/bg-scripts/commitdiff_plain/64f2a363dab6a9abad19f5227d9aa119264f8e23 Check that the input filename exists before attempting to convert it's format. --- diff --git a/wallchanger.py b/wallchanger.py index fa1c5d0..7d6cd6a 100755 --- a/wallchanger.py +++ b/wallchanger.py @@ -84,6 +84,8 @@ class BaseChanger(object): def convert_image_format(self, filename, format='BMP', allowAlpha=False, extension='.bmp'): """Convert the image to another format, and store it in a local place""" + if not os.path.exists(filename): + return filename, False import PIL, PIL.Image self.remove_old_image_cache()