Skip to content
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

Extracted image is being distorted #2411

Open
stefan6419846 opened this issue Jan 15, 2024 · 0 comments
Open

Extracted image is being distorted #2411

stefan6419846 opened this issue Jan 15, 2024 · 0 comments
Labels
workflow-images From a users perspective, image handling is the affected feature/workflow

Comments

@stefan6419846
Copy link
Collaborator

When extracting an image from some specific PDF file, the corresponding output file is distorted. Evince and pdfimages are able to extract correct images.

Environment

Which environment were you using when you encountered the problem?

$ python -m platform
Linux-5.14.21-150400.24.100-default-x86_64-with-glibc2.31

$ python -c "import pypdf;print(pypdf._debug_versions)"
pypdf==3.17.4, crypt_provider=('local_crypt_fallback', '0.0.0'), PIL=10.1.0

Code + PDF

This is a minimal, complete example that shows the issue:

from pypdf import PdfReader


for page in PdfReader('out1.pdf').pages:
    for image in page.images:
        if image.name == "Im15.png":
            image.image.save(image.name)

I have sent the PDF file to @MartinThoma directly for privacy reasons.

Traceback

Nothing to see here, just a distorted image inside the image viewer.

@MartinThoma MartinThoma added the workflow-images From a users perspective, image handling is the affected feature/workflow label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow-images From a users perspective, image handling is the affected feature/workflow
Projects
None yet
Development

No branches or pull requests

2 participants