From 0ddf497327fcc321f11322c7eca118c5211f1a87 Mon Sep 17 00:00:00 2001 From: avigoyal Date: Wed, 17 Oct 2018 12:53:28 +0530 Subject: [PATCH] Support thumbnail using width value only # Supported for geometry_string value options widthx, xheight and widthxheight earlier it was not supporting widthx eg:- 1. 400x600 (resize image with width 400 and height 600) 2. 400x (resize image with width 400 and keep height in proportion to original image) 3 x600 (resize image with height 600 and keep width in proportion to original image) --- sorl/thumbnail/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorl/thumbnail/parsers.py b/sorl/thumbnail/parsers.py index 89538d0d4..db38713ea 100644 --- a/sorl/thumbnail/parsers.py +++ b/sorl/thumbnail/parsers.py @@ -7,7 +7,7 @@ bgpos_pat = re.compile(r'^(?P\d+)(?P%|px)$') -geometry_pat = re.compile(r'^(?P\d+)?(?:x(?P\d+))?$') +geometry_pat = re.compile(r'^(?P[\d]+)?(?:x)(?P\d+)?$') class ThumbnailParseError(ThumbnailError):