fix: formula conversion with page_range param set (#1791)

When page_range param is used for formula conversion,
the system throws list index out of range error.

Included tests to validate that the fix works.

Signed-off-by: Masum <masumsofts@yahoo.com>
This commit is contained in:
Mahafuzur Rahman
2025-06-17 17:58:45 +06:00
committed by GitHub
parent c2ef69718a
commit dbab30e92c
2 changed files with 23 additions and 1 deletions

View File

@@ -86,7 +86,7 @@ class BaseItemAndImageEnrichmentModel(
coord_origin=bbox.coord_origin,
)
page_ix = element_prov.page_no - 1
page_ix = element_prov.page_no - conv_res.pages[0].page_no - 1
cropped_image = conv_res.pages[page_ix].get_image(
scale=self.images_scale, cropbox=expanded_bbox
)