From ea309bff97bb3f291d15c769775fd1b0b6cd25d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Tue, 12 Jan 2016 09:48:00 +0800 Subject: [PATCH 1/2] Pass filename instead of file object when calling PIL.Image.save() --- mediagoblin/media_types/ascii/processing.py | 7 ++----- mediagoblin/media_types/image/processing.py | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mediagoblin/media_types/ascii/processing.py b/mediagoblin/media_types/ascii/processing.py index ed6600ee..00d04e63 100644 --- a/mediagoblin/media_types/ascii/processing.py +++ b/mediagoblin/media_types/ascii/processing.py @@ -143,11 +143,8 @@ class CommonAsciiProcessor(MediaProcessor): thumb = converter._create_image( orig_file.read()) - with open(tmp_thumb, 'w') as thumb_file: - thumb.thumbnail( - thumb_size, - Image.ANTIALIAS) - thumb.save(thumb_file) + thumb.thumbnail(thumb_size, Image.ANTIALIAS) + thumb.save(tmp_thumb); thumb_info = {'font': font, 'width': thumb_size[0], diff --git a/mediagoblin/media_types/image/processing.py b/mediagoblin/media_types/image/processing.py index 951a720d..14091d6e 100644 --- a/mediagoblin/media_types/image/processing.py +++ b/mediagoblin/media_types/image/processing.py @@ -77,8 +77,7 @@ def resize_image(entry, resized, keyname, target_name, new_size, # Copy the new file to the conversion subdir, then remotely. tmp_resized_filename = os.path.join(workdir, target_name) - with open(tmp_resized_filename, 'wb') as resized_file: - resized.save(resized_file, quality=quality) + resized.save(tmp_resized_filename, quality=quality) store_public(entry, keyname, tmp_resized_filename, target_name) # store the thumb/medium info From 64c035b39fe76bf07d8b12152d1f14574c9e4677 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 21 Jan 2016 12:37:50 -0800 Subject: [PATCH 2/2] Issue #5394: Wrong url for forgot_password in basic_auth plugin Fix by jerome. Thank you! --- mediagoblin/plugins/basic_auth/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediagoblin/plugins/basic_auth/views.py b/mediagoblin/plugins/basic_auth/views.py index 95f91b4c..86d7eaef 100644 --- a/mediagoblin/plugins/basic_auth/views.py +++ b/mediagoblin/plugins/basic_auth/views.py @@ -63,7 +63,8 @@ def forgot_password(request): messages.add_message(request, messages.WARNING, _("Couldn't find someone with that username.")) - return redirect(request, 'mediagoblin.auth.forgot_password') + return redirect(request, + 'mediagoblin.plugins.basic_auth.forgot_password') success_message = _("An email has been sent with instructions " "on how to change your password.")