x2pdf command adds images to pdf in the wrong order
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 571
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
I ran this command:
uvx pdfly x2pdf *.jpeg -o output.pdf
The pdfly x2pdf command will convert a folder of images (organized like 0001.jpeg, 0002.jpeg, 0003.jpeg, etc.) into a pdf that is backwards where the 3rd jpeg is the 1st page in the pdf.
I think it's because this line will add the new_page at index 0 for every filepath and it ends up prepending instead of appending:
https://github.com/py-pdf/pdfly/blob/06f79b3f038715f99e306382e12306607db0e8ad/pdfly/x2pdf.py#L42
Environment
- Operating System: Fedora Linux 43
- Python version: 3.13.11
- pdfly version used: 0.5.1
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with pdfly/x2pdf.py at the linked line and reproduce uvx pdfly x2pdf *.jpeg -o output.pdf using sequentially named images. Check the generated PDF page order against the input order; done means the first image is the first page and later images follow sequentially.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100