mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-29 02:54:49 +00:00
Access feature attributes by index
When the FocalPoint class was removed, detect_features was updated to return tuples. This commit fixes a typo where the x and y attributes were still being accessed as attributes.
This commit is contained in:
parent
c506f6751f
commit
8a3ccbef26
1 changed files with 4 additions and 4 deletions
|
|
@ -135,10 +135,10 @@ class AbstractImage(models.Model, TagSearchable):
|
|||
features = feature_detector.detect_features()
|
||||
if features:
|
||||
# Create a bounding box around all features
|
||||
left = min(feature.x for feature in features)
|
||||
top = min(feature.y for feature in features)
|
||||
right = max(feature.x for feature in features)
|
||||
bottom = max(feature.y for feature in features)
|
||||
left = min(feature[0] for feature in features)
|
||||
top = min(feature[1] for feature in features)
|
||||
right = max(feature[0] for feature in features)
|
||||
bottom = max(feature[1] for feature in features)
|
||||
focal_point = Rect(left, top, right, bottom)
|
||||
else:
|
||||
return None
|
||||
|
|
|
|||
Loading…
Reference in a new issue