Skip to content

Commit 5e96a55

Browse files
authored
Fix missing spatial object when creating a new bounding box with enclosing_bbox
2 parents b7510e6 + b82099d commit 5e96a55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

textractor/entities/bbox.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ def enclosing_bbox(cls, bboxes, spatial_object: SpatialObject = None):
213213
logging.warning("At least one bounding box needs to be non-null")
214214
return BoundingBox(0, 0, 1, 1, spatial_object=spatial_object)
215215

216+
if spatial_object is None:
217+
spatial_object = bboxes[0].spatial_object
218+
216219
for bbox in bboxes:
217220
if bbox is not None:
218221
x1 = min(x1, bbox.x)

0 commit comments

Comments
 (0)