From 046bd84f538ba7fa340091861b1630e86eed2023 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 9 Sep 2014 10:11:53 +0100 Subject: [PATCH] Don't process -c parameter on non fill filters --- wagtail/wagtailimages/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailimages/models.py b/wagtail/wagtailimages/models.py index dbb3f1794..054938e91 100644 --- a/wagtail/wagtailimages/models.py +++ b/wagtail/wagtailimages/models.py @@ -287,7 +287,7 @@ class Filter(models.Model): if match: return Filter.OPERATION_NAMES[match.group(1)], int(match.group(2)) - match = re.match(r'(max|min|fill)-(\d+)x(\d+)-c(\d+)$', self.spec) + match = re.match(r'(fill)-(\d+)x(\d+)-c(\d+)$', self.spec) if match: width = int(match.group(2)) height = int(match.group(3)) @@ -298,7 +298,7 @@ class Filter(models.Model): if match: width = int(match.group(2)) height = int(match.group(3)) - return Filter.OPERATION_NAMES[match.group(1)], (width, height, None) + return Filter.OPERATION_NAMES[match.group(1)], (width, height) # Spec is not one of our recognised patterns raise Filter.InvalidFilterSpecError("Invalid image filter spec: %r" % self.spec)