I'm developing a website with:
- Python
- Django
- Wagtail
In this project there are a lot of images and all of them have an ugly yellow border. In order to remove this border I need to crop all the images sistematically.
Every image has its own focal area (feature supplied by wagtail), a box that exclude the yellow border. However the standard tool for cropping, of wagtail, is useless in this situation and to achieve my goal I've decided to use easy-thumbnails.
Here an example of code in which I use the focal_point of image_object to set all the parameters needed for the cropping operation:
parameters = {
'size': (width, height),
'crop': True,
'detail': False,
'upscale': False,
}
if image_object.has_focal_point():
focal_point = image_object.get_focal_point()
parameters['box'] = "%s,%s,%s,%s" % (
int(focal_point.left),
int(focal_point.top),
int(focal_point.right - focal_point.left),
int(focal_point.bottom - focal_point.top),
)
return get_thumbnailer(image_object.file).get_thumbnail(parameters, generate=True).url
My question is about the "box" parameter. I can't find it on the easy thumbnails docs but I've found examples of use around internet.
Can anyone tell me where I can found any reference about it? Or at least a list of all the parameters allowed with the get_thumbnail method?
Thanks in advance, nifel87