-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
page.to_image() PDFium: Data format erro #1179
Comments
Thank you for raising this issue. Please try updating to the latest version of |
@jwilk without lock, when i run it at the same time with two big file, i will get these error
and i add lock ,it work ok
but with lock ,Efficiency is too low |
@jsvine could you give me some idea to fix it, i don't know what can i do to improve efficiency |
Hi @dalinautoagents, those code snippets reference external unstated variables and also combine image-related processing with other logic, creating an obstacle to reproduction. Could you create a simplified Python script that can be run directly and reproduces the error you're seeing? |
Describe the bug
A clear and concise description of what the bug is.
Have you tried repairing the PDF?
Please try running your code with
pdfplumber.open(..., repair=True)
before submitting a bug report.Code to reproduce the problem
Paste it here, or attach a Python file.
PDF file
Please attach any PDFs necessary to reproduce the problem.
If you need to redact text in a sensitive PDF, you can run it through JoshData/pdf-redactor.
Expected behavior
What did you expect the result should have been?
Actual behavior
What actually happened, instead?
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
Add any other context/notes about the problem here.
it's easy to reproduce, two big pdf,and run code:
self.pdf = pdfplumber.open(fnm) if isinstance(
fnm, str) else pdfplumber.open(BytesIO(fnm))
self.page_images = [p.to_image(resolution=72 * zoomin).annotated for i, p in
enumerate(self.pdf.pages[page_from:page_to])]
I think there's a concurrency issue with 'to_image'
update-----
when i try to add lock ,and it works ok
The text was updated successfully, but these errors were encountered: