Projet

Général

Profil

0001-misc-create-thumbnail-as-jpeg-in-case-of-unknown-fil.patch

Frédéric Péters, 20 juin 2021 14:59

Télécharger (1,02 ko)

Voir les différences:

Subject: [PATCH] misc: create thumbnail as jpeg in case of unknown file format
 (#54667)

 ckeditor/image/pillow_backend.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
ckeditor/image/pillow_backend.py
24 24

  
25 25
def create_thumbnail(file_path):
26 26
    thumbnail_filename = utils.get_thumb_filename(file_path)
27
    thumbnail_format = utils.get_image_format(os.path.splitext(file_path)[1])
27
    try:
28
        thumbnail_format = utils.get_image_format(os.path.splitext(file_path)[1])
29
    except KeyError:
30
        thumbnail_format = 'image/jpeg'
28 31
    file_format = thumbnail_format.split('/')[1]
29 32

  
30 33
    image = default_storage.open(file_path)
31
-