PDFToImageContent generates duplicate images for repeated page selections
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start at _expand_page_range() in the PDF converter utilities and the PDFToImageContent component that calls it; reproduce with page_range=[1, 1] to see the duplicated image. Read the existing converter tests to see how page ranges are asserted, then confirm that the fix deduplicates pages while preserving the original selection order. Done looks like one image per unique page for repeated and overlapping ranges, with tests covering both cases.
Written by the indexing model from the issue text.
Description
I noticed an issue with PDFToImageContent when the same PDF page is selected more than once.
For an example, selecting page 1 twice using page_range=[1, 1] generates two images of the same page instead of one.
Shows comparison of the output when selecting page 1 once and twice.
I also checked the expand_page_range() utility and noticed that it keeps duplicate page numbers when ranges overlap or the same page is specified multiple times.
I think each page should only be processed once while preserving the original selection order.
Could someone please confirm if this is the expected behaviour?
If not I'd be happy to work on a fix and add the necessary tests.
- Dominant language
- Python
- Stars
- 27.1k
- Forks
- 3.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 239
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepset-ai/haystack
-
BlockingConfirmationStrategy ignores an empty argument replacementPossibly taken @Aarkin7 claimed this 3 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
deepset-ai/haystack#13863 · 2 comments ·
Maintainers usually reply within 1 day
-
DocumentSplitter misplaces repeated literal chunks from an overlapping custom splitterPossibly taken @davidsbatista claimed this 7 days ago. OpenP2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13806 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
CSVToDocument accepts an unsupported conversion_mode and silently converts in row modePossibly taken @Lesereingrape claimed this 54 days ago. OpenP3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
deepset-ai/haystack#13070 ·
Maintainers usually reply within 1 day
-
InMemoryDocumentStore: count_unique_metadata_by_filter and get_metadata_field_unique_values disagree on int/float/bool valuesPossibly taken @sjrl claimed this 14 days ago. OpenP3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13040 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
CSVToDocument row mode fails on CR-separated CSV inputPossibly taken @julian-risch claimed this 55 days ago. OpenP3
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
deepset-ai/haystack#13022 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in deepset-ai/haystack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
micronaut-projects/micronaut-core#14585 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
langgenius/graphon#443 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
[BUG]: Management endpoints /v1/memory/stats and /v1/memory/counts bypass API key authenticationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
docling-project/docling-serve#788 ·
Maintainers usually reply within 1 day
-
Mend: dependency security vulnerability untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
opensearch-project/cross-cluster-replication#1805 ·
Maintainers usually reply within 1 day