Don't use crop closeness if it's out of range

This commit is contained in:
Karl Hobley 2014-09-16 15:27:01 +01:00
parent 4757c1633c
commit 9e3bec0d5f

View file

@ -176,9 +176,10 @@ class BaseImageBackend(object):
# Apply max crop closeness
crop_closeness = min(crop_closeness, max_crop_closeness)
# Get crop width and height
crop_width = crop_max_width + (crop_min_width - crop_max_width) * crop_closeness
crop_height = crop_max_height + (crop_min_height - crop_max_height) * crop_closeness
if 1 >= crop_closeness >= 0:
# Get crop width and height
crop_width = crop_max_width + (crop_min_width - crop_max_width) * crop_closeness
crop_height = crop_max_height + (crop_min_height - crop_max_height) * crop_closeness
# Find focal point UV
if focal_point is not None:
@ -243,7 +244,7 @@ class BaseImageBackend(object):
bottom = im_height
# Crop!
return self.resize_to_min(self.crop(image, Rect(left, top, right, bottom)), size)
return self.resize_to_min(self.crop(image, Rect(left, top, right, bottom)), (100, 100))
def no_operation(self, image, param, focal_point=None):