mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-08 23:44:44 +00:00
Don't process -c parameter on non fill filters
This commit is contained in:
parent
b02d8db666
commit
046bd84f53
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue