Return None when no features detected

pull/752/head
Karl Hobley 2014-11-04 17:10:43 +00:00
rodzic 638c6bc947
commit 27832b3282
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -140,6 +140,8 @@ class AbstractImage(models.Model, TagSearchable):
right = max(feature.x for feature in features)
bottom = max(feature.y for feature in features)
focal_point = Rect(left, top, right, bottom)
else:
return None
# Add 20% to width and height and give it a minimum size
x, y = focal_point.centroid