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

fixed skip-big when there are no images in pdf #152

Merged
merged 4 commits into from Apr 18, 2017

Conversation

TomRaz
Copy link
Contributor

@TomRaz TomRaz commented Apr 18, 2017

This happens when you are using --skip-big argument, and having a pdf without images, and only text.
In this case, the dic pageinfo is missing "width_pixels" and "height_pixels", causing the following exception:
ERROR - Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/ruffus/task.py", line 751, in run_pooled_job_without_exceptions register_cleanup, touch_files_only) File "/usr/local/lib/python3.5/dist-packages/ruffus/task.py", line 567, in job_wrapper_io_files ret_val = user_defined_work_func(*params) File "/usr/local/lib/python3.5/dist-packages/ocrmypdf/pipeline.py", line 294, in split_pages '.ocr.page.pdf' if is_ocr_required(pageinfo, log, options) \ File "/usr/local/lib/python3.5/dist-packages/ocrmypdf/pipeline.py", line 251, in is_ocr_required pixel_count = pageinfo['width_pixels'] * pageinfo['height_pixels'] KeyError: 'width_pixels'

@jbarlow83
Copy link
Collaborator

Looks good - thanks for contributing!

@jbarlow83 jbarlow83 merged commit 345256e into ocrmypdf:master Apr 18, 2017
jbarlow83 pushed a commit that referenced this pull request Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants