docling-project / docling-project/docling
The image is not returned in VlmPipeline when generate_page_images=True
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
I think the problem is in the VLMPipeline line 399:
```python
image = page.image
page_no = pg_idx + 1
bounding_boxes = []
if page.size:
pg_width = page.size.width
pg_height = page.size.height
size = Size(width=pg_width, height=pg_height)
parent_page = doc.add_page(page_no=page_no, size=size)
```
Should be something like:
```python
image = page.image
page_no = pg_idx + 1
bounding_boxes = []
if page.size:
pg_width = page.size.width
pg_height = page.size.height
size = Size(width=pg_width, height=pg_height)
if self.keep_images:
image_ref = ImageRef.from_pil(image, dpi=not_sure_about_this_one)
else:
image_ref=None
parent_page = doc.add_page(page_no=page_no, size=size, image=image_ref)
```
Contributor guide
Assessment
This issue has not been assessed yet.