Ticket #5386: 0001-Specify-the-format-when-save-the-resized-image.patch

File 0001-Specify-the-format-when-save-the-resized-image.patch, 1.1 KB (added by 宋文武, 8 years ago)
  • mediagoblin/media_types/image/processing.py

    From 3ac37408f28529eb152217552670d90a5088714c Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
    Date: Tue, 12 Jan 2016 09:48:00 +0800
    Subject: [PATCH] Specify the format when save the resized image
    
    ---
     mediagoblin/media_types/image/processing.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/mediagoblin/media_types/image/processing.py b/mediagoblin/media_types/image/processing.py
    index 951a720..9354650 100644
    a b def resize_image(entry, resized, keyname, target_name, new_size,  
    7878    # Copy the new file to the conversion subdir, then remotely.
    7979    tmp_resized_filename = os.path.join(workdir, target_name)
    8080    with open(tmp_resized_filename, 'wb') as resized_file:
    81         resized.save(resized_file, quality=quality)
     81        resized.save(resized_file, format=resized.format, quality=quality)
    8282    store_public(entry, keyname, tmp_resized_filename, target_name)
    8383
    8484    # store the thumb/medium info