mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-12 09:13:14 +00:00
Fix minor bug with crop
This commit is contained in:
parent
11400e3df7
commit
db65b22d5a
2 changed files with 5 additions and 4 deletions
|
|
@ -128,5 +128,5 @@ class BaseImageBackend(object):
|
|||
(The final image will match the requested size, unless one or the other dimension is
|
||||
already smaller than the target size)
|
||||
"""
|
||||
resized_image = resize_to_min(image, size)
|
||||
resized_image = self.resize_to_min(image, size)
|
||||
return self.crop_to_centre(resized_image, size)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class WandBackend(BaseImageBackend):
|
|||
|
||||
left = (original_width - final_width) / 2
|
||||
top = (original_height - final_height) / 2
|
||||
return image.crop(
|
||||
(left, top, left + final_width, top + final_height)
|
||||
)
|
||||
image.crop(
|
||||
left=left, top=top, right=left + final_width, bottom=top + final_height
|
||||
)
|
||||
return image
|
||||
|
|
|
|||
Loading…
Reference in a new issue