-
Notifications
You must be signed in to change notification settings - Fork 932
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
Fix comparations for image colorspace literals #132
Conversation
Hi @bashkirtsevich, thanks for your contribution. This is a very late response... We don't have any test that run this code so I am not sure if this breaks any other kind of pdfs. I can imagine that sometimes the colorspace is a list and sometimes it is not. Do you have any idea if that is the case? If you want this to be merged you should also add a a test. That makes sure that this code can actually be run (which I believe by looking at it) and it will make sure that we don't change it without thinking. Do you have time to work on this? |
In my PR I just fix logical mistakes such as |
I've just checked if any of our current tests is using the But we do have some sample pdf's that contain images. This is the result of evaluating
Both pdfs have a list of colorspaces instead of a single value. And thus our current way of checking e.g. |
I've checked the code from this PR with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to have some tests for this code but @bashkirtsevich indicated that he does not have time to work on this.
I've checked the code with pdf's that contain images and that works!
So, I suggest we merge this into develop.
@pietermarsman I have a pdf with some images write as general ".img" files, how could I convert these images to jpg format? I use pdf2txt, the first 3 bytes of the stream are H\x89\xec, the corresponding hex is 4889ec. |
pdfminer.six writes to a .img file if it cannot infer the type of the image. It supports jpeg (.jpg), jbig2 (.jb2) and grayscale (.bmp) images. The bytes of an unrecognized images type are written to this extention: Please share if you find a way to open the images. Perhaps we can add it to pdfminer.six. |
See issue #131
Python: 3.6.3