fix(debug): Missing translation of bbox to to_bounding_box (#1220)
* Fix: Add missing bbox attribute to PdfTextCell * Fix: Add missing bbox attribute to PdfTextCell Signed-off-by: hl2311 <dhlong2301@gmail.com> * fix: Refactor missing bbox attribute to PdfTextCell Signed-off-by: hl2311 <dhlong2301@gmail.com> * Signed-off-by: hl2311 <dhlong2301@gmail.com> fix: Refactor missing bbox attribute to PdfTextCell --------- Signed-off-by: hl2311 <dhlong2301@gmail.com>
This commit is contained in:
parent
f739d0e4c5
commit
6df8827231
@ -63,7 +63,13 @@ class PagePreprocessingModel(BasePageModel):
|
||||
def draw_text_boxes(image, cells, show: bool = False):
|
||||
draw = ImageDraw.Draw(image)
|
||||
for c in cells:
|
||||
x0, y0, x1, y1 = c.bbox.as_tuple()
|
||||
x0, y0, x1, y1 = (
|
||||
c.to_bounding_box().l,
|
||||
c.to_bounding_box().t,
|
||||
c.to_bounding_box().r,
|
||||
c.to_bounding_box().b,
|
||||
)
|
||||
|
||||
draw.rectangle([(x0, y0), (x1, y1)], outline="red")
|
||||
if show:
|
||||
image.show()
|
||||
|
Loading…
Reference in New Issue
Block a user