]> code.delx.au - bg-scripts/blobdiff - wallchanger.py
Check that the input filename exists before attempting to convert it's format.
[bg-scripts] / wallchanger.py
index fa1c5d08b2827a6a1ed135d38787280bddb486ee..7d6cd6a9d97682575790049f1e2abd7405a645b2 100755 (executable)
@@ -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()