docling-project / docling-project/docling
PDF extraction fails when specific image is present in file
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug description
When running extraction on a PDF containing a specific embedded image, the process fails.
If I remove the image from the PDF and re-run the extraction, it works correctly.
### Steps to reproduce
1. Configure the converter with the following pipeline options:
```
# Configure OCR options
pipeline_options = PdfPipelineOptions()
pipeline_options.do_ocr = True
pipeline_options.do_table_structure = True
pipeline_options.table_structure_options.do_cell_matching = True
# Set accelerator to CPU to avoid pin_memory warnings when no GPU is available
pipeline_options.accelerator_options = AcceleratorOptions(
num_threads=multiprocessing.cpu_count(), device=AcceleratorDevice.AUTO
)
pipeline_options.images_scale = 1.0
pipeline_options.generate_page_images = True
pipeline_options.generate_picture_images = True
pipeline_options.ocr_options = EasyOcrOptions(force_full_page_ocr=False)
pipeline_options.do_picture_classification = True
pipeline_options.do_picture_description = False
# Create converter and process document
self.converter = DocumentConverter(
allowed_formats=[
InputFormat.PDF,
],
format_options={
InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options),
}
)
# Only process the first page
self.converter.convert(pdf_file_path, page_range=(1, 1))
```
2. Run extraction on the problematic PDF (attached separately).
3. Observe failure.
4. Edit the PDF to remove the image.
5. Run extraction again → works fine.
### Docling version
```
docling --version
Docling version: 2.46.0
Docling Core version: 2.45.0
Docling IBM Models version: 3.9.0
Docling Parse version: 4.2.3
Python: cpython-312 (3.12.3)
Platform: Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39
```
### Python version
Python 3.13.7
[With the problematic image - European Climate Risk Assessment10pages.pdf](https://github.com/user-attachments/files/22173883/European.Climate.Risk.Assessment10pages.pdf)
[Without the problematic image - European Climate Risk Assessment10pages (1).pdf](https://github.com/user-attachments/files/22173882/European.Climate.Risk.Assessment10pages.1.pdf)
Contributor guide
Assessment
This issue has not been assessed yet.