diff --git a/da_vinci/images.py b/da_vinci/images.py index 71bd28b..3e5eb2d 100644 --- a/da_vinci/images.py +++ b/da_vinci/images.py @@ -92,7 +92,10 @@ def get_filename(self): """Generates a suitable filename based on image name and format.""" name = self.filename or self.name filename, extension = os.path.splitext(name) - return '%s.%s' % (filename, formats.EXTENSIONS[self.format]) + try: + return '%s.%s' % (filename, formats.EXTENSIONS[self.format]) + except KeyError: + return name def show(self): """Displays the image, mainly for debugging purposes.