mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-17 05:40:25 +00:00
Don't get extension of empty filename
This commit is contained in:
parent
af7c12cb68
commit
7b34716d9e
1 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ class SpecFileGenerator(object):
|
|||
|
||||
# Determine the format.
|
||||
format = self.format
|
||||
if not format:
|
||||
if filename and not format:
|
||||
# Try to guess the format from the extension.
|
||||
extension = os.path.splitext(filename)[1].lower()
|
||||
if extension:
|
||||
|
|
@ -37,7 +37,7 @@ class SpecFileGenerator(object):
|
|||
format = extension_to_format(extension)
|
||||
except UnknownExtensionError:
|
||||
pass
|
||||
format = format or img.format or original_format or 'JPEG'
|
||||
format = format or img.format or original_format or 'JPEG'
|
||||
|
||||
imgfile = img_to_fobj(img, format, **options)
|
||||
content = IKContentFile(filename, imgfile.read())
|
||||
|
|
|
|||
Loading…
Reference in a new issue