From 64f2a363dab6a9abad19f5227d9aa119264f8e23 Mon Sep 17 00:00:00 2001 From: Greg Darke Date: Sun, 15 Mar 2009 12:28:36 +1100 Subject: [PATCH] Check that the input filename exists before attempting to convert it's format. --- wallchanger.py | 2 ++ 1 file changed, 2 insertions(+) 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() -- 2.39.2