Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion da_vinci/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down