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

Bitmap PNGs are not decoded #535

Closed
chrisegner opened this issue Feb 12, 2020 · 7 comments · Fixed by #1067
Closed

Bitmap PNGs are not decoded #535

chrisegner opened this issue Feb 12, 2020 · 7 comments · Fixed by #1067
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF workflow-images From a users perspective, image handling is the affected feature/workflow

Comments

@chrisegner
Copy link

The current implementation of FlateDecode.decode assumes the PNG is encoded with BitsPerComponent == 8. This is not valid for bitmap PNGs. In this case, each row is still prefixed with the filter byte then followed by the bits, padded out to the final byte.

Pull request coming shortly.

@jansindl3r
Copy link

it is so dead here, nobody merges. Does anyone know about an active fork? :(

@zoj613
Copy link

zoj613 commented May 4, 2020

it is so dead here, nobody merges. Does anyone know about an active fork? :(

https:/claird/PyPDF4

@MartinThoma MartinThoma added the workflow-images From a users perspective, image handling is the affected feature/workflow label Apr 6, 2022
@MartinThoma
Copy link
Member

@jansindl3r @zoj613 I just became the maintainer of PyPDF2 this month - and we did merge quite a lot! Things are moving in the right direction, but it will take time to clean up things. Be a bit more patient 🙏

I don't think PyPDF4 is the way to go. It doesn't have enough community support. Now that I clean things up in PyPDF2, I guess it will outpace PyPDF4 quickly (if it hasn't already; you have to judge)

@zoj613
Copy link

zoj613 commented Apr 16, 2022

@MartinThoma thanks a lot for the effort. This is great to hear. I would be happy to contribute where I can, though I must say I know very little about the structure of pdf files.

@MartinThoma
Copy link
Member

Does anybody have a PDF + Python code that shows the issue described here?

@MartinThoma MartinThoma added the is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF label Jun 26, 2022
MartinThoma added a commit that referenced this issue Jul 6, 2022
Closes #535
Closes #536

Co-authored-by: Christopher Egner <[email protected]>
MartinThoma added a commit that referenced this issue Jul 9, 2022
…ding PNGs (#1067)

Closes #535
Closes #536

Co-authored-by: Christopher Egner <[email protected]>
@MartinThoma
Copy link
Member

Sorry for the long wait - the support for BitsPerComponent was added, along with the support of indexed color spaces 🎉

I will probably release PyPDF==2.5.0 on Sunday (10.07.2022).

Thanks to everybody ❤️

@zoj613
Copy link

zoj613 commented Jul 9, 2022

Thank you for the hard work @MartinThoma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF workflow-images From a users perspective, image handling is the affected feature/workflow
Projects
None yet
4 participants