docling-project / docling-project/docling
Rotated image is skipped on last PDF page; works if file is reexported with libreoffice
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 95
Description
### Bug
I have a file with 90 degrees rotated diagram on last page (23). Docling doesn't extract any data from that page except for image bbox:
```json
{
"self_ref": "#/pictures/6",
"parent": {
"$ref": "#/body"
},
"children": [],
"content_layer": "body",
"label": "picture",
"prov": [
{
"page_no": 23,
"bbox": {
"l": 77.53998565673828,
"t": 747.2734870910645,
"r": 550.130859375,
"b": 32.326416015625,
"coord_origin": "BOTTOMLEFT"
},
"charspan": [
0,
0
]
}
],
"captions": [],
"references": [],
"footnotes": [],
"annotations": []
}
```
When I tried to cut the page out for debugging with libreoffice I noticed that it started working. It appears that even reexporting entire document as is results in correct detection.
I attached both files and both jsons for comparisons.
### Steps to reproduce
Run document against docling-serve `0.15.0` with default options (pdf v4, accurate tables, no vlm)
You can search for `Exhibit 12` label
### Docling version
`2.36.1` : https://github.com/docling-project/docling-serve/blob/717fb3a8d82609ebfffb35eff76ce5a751314d35/uv.lock#L576
### Python version
`3.12`: https://github.com/docling-project/docling-serve/blob/717fb3a8d82609ebfffb35eff76ce5a751314d35/Containerfile#L1
[orig.json](https://github.com/user-attachments/files/20823492/orig.json)
[reexported.json](https://github.com/user-attachments/files/20823491/reexported.json)
[orig.pdf](https://github.com/user-attachments/files/20823509/orig.pdf)
[reexported.pdf](https://github.com/user-attachments/files/20823508/reexported.pdf)
Contributor guide
Research direction
Start by reproducing the report with docling-serve 0.15.0 using the attached orig.pdf and default options, then compare page 23 and “Exhibit 12” with reexported.pdf and the two JSON outputs. Trace how the rotated image on the final page is processed; done means the original PDF extracts the same page data as the reexported file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100