-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
"OSError: encoder error -2 when writing image file" while enumerating images #2265
Comments
@michelcrypt4d4mus |
this is the line of code that is causing the error and sorry i thought i had attached the file but somehow it did not attach... trying again |
Like #2266 this issue seems to go away when i downgrade to PyPDF 3.14.0 |
@michelcrypt4d4mus |
It seems like this still raises the same issue: >>> from pypdf import PdfReader
>>> reader = PdfReader('../Binance.discovery.responses.2.gov.uscourts.dcd.256060.140.1.pdf')
>>> for page in reader.pages:
... print(page)
... for image in page.images:
... print(image)
... print(image.image)
... |
the error is linked due to pillow not handling all formats as requested (JPEG2000 with Palette encoding). |
as mentioned this was not an issue with PyPDF 3.14.0 |
Exception while enumerating images.
This seems to be a regression - when I was including 3.14.0 in clown_sort i rarely if ever had issues enumerating pages. Now I have them in a large % of PDFs.
Environment
Which environment were you using when you encountered the problem?
$ python -m platform 3.11.5 $ python -c "import pypdf;print(pypdf._debug_versions)" 3.16.4
Code + PDF
See exception text. PDF attached; you can add it to your tests.
Traceback
The text was updated successfully, but these errors were encountered: