unstructured: bug/PIL.UnidentifiedImageError: cannot identify image file
Describe the bug
I am getting the following error when extracting text and images from pdf:
PIL.UnidentifiedImageError: cannot identify image file '/tmp/tmpjy0tjjjd/2c2e244f-8f8e-46de-a7bc-2ecfbaa254ea-566.ppm'
To Reproduce
The way I am using unstructured is:
Expected behavior Ideally, all the images in the pdf must be extracted. If at all there is a failure, image extraction must not fail abruptly for the complete document(in my case, the pdf has 800 pages and it fails after going through 600 pages). For the layouts where image extraction failed, we can add a flag in the metadata that conveys that the image extraction failed and also provide reason for it. We should be able to get elements even in case of failures through a flag that is passed when calling partition().
Environment Info
Any kind of quickfix to get elements even in case of failure would also be appreciated.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 26 (12 by maintainers)
Hi @MthwRobinson, I got the above error in this file: https://camelot-py.readthedocs.io/en/master/_static/pdf/foo.pdf Appreciate your efforts.
Okay, looks like PPMs are coming from
pdftoppm(part ofpoppler) as part of the process, so that explains theppmbit anyway.