misc: create thumbnail as jpeg in case of unknown file format (#54667)
This commit is contained in:
parent
850ddaefe5
commit
c7c3336b16
|
@ -24,7 +24,10 @@ def image_verify(f):
|
|||
|
||||
def create_thumbnail(file_path):
|
||||
thumbnail_filename = utils.get_thumb_filename(file_path)
|
||||
thumbnail_format = utils.get_image_format(os.path.splitext(file_path)[1])
|
||||
try:
|
||||
thumbnail_format = utils.get_image_format(os.path.splitext(file_path)[1])
|
||||
except KeyError:
|
||||
thumbnail_format = 'image/jpeg'
|
||||
file_format = thumbnail_format.split('/')[1]
|
||||
|
||||
image = default_storage.open(file_path)
|
||||
|
|
Loading…
Reference in New Issue