Compare commits

..
8 Commits
Author SHA1 Message Date
James R. Barlow 12bc58b5b6 Merge branch 'hotfix/v3.1.1' 2016-01-09 18:45:40 -08:00
James R. Barlow 6af0815681 Bump version 2016-01-09 18:45:06 -08:00
James R. Barlow 424b4b33b1 Just go right ahead and demand Python 3.4 2016-01-04 12:56:51 -08:00
James R. Barlow e510f89792 Python 2 warning message 2015-12-21 09:38:38 -08:00
James R. Barlow 49cd6cc619 Off by one error in page info calculation 2015-12-21 09:35:02 -08:00
jbarlow83 9f37446155 Merge pull request #34 from shemgp/master
Don't exit when qpdf repairs the file successfully but displays warning
2015-12-16 20:46:47 -08:00
Shem Pasamba d7c7559b05 Use boolean instead of integers 2015-12-17 11:23:27 +08:00
Shem Pasamba b2b66d1344 Don't exit when qpdf repair was successful 2015-12-17 11:20:20 +08:00
4 changed files with 25 additions and 6 deletions
+8
View File
@@ -6,6 +6,14 @@ Please always read this file before installing the package
Download software here: https://github.com/jbarlow83/OCRmyPDF/tags
v3.1.1:
Changes
-------
- Fixed bug that caused incorrect page size and DPI calculations on documents with mixed page sizes
v3.1:
=====
+8 -2
View File
@@ -39,7 +39,7 @@ warnings.simplefilter('ignore', pypdf.utils.PdfReadWarning)
BASEDIR = os.path.dirname(os.path.realpath(__file__))
VERSION = '3.1'
VERSION = '3.1.1'
# -------------
@@ -356,14 +356,20 @@ def repair_pdf(
try:
out = check_output(args_qpdf, stderr=STDOUT, universal_newlines=True)
except CalledProcessError as e:
exit_with_error = True
if e.returncode == 2:
print("{0}: not a valid PDF, and could not repair it.".format(
options.input_file))
print("Details:")
print(e.output)
elif e.returncode == 3 and e.output.find("operation succeeded"):
exit_with_error = False
out = e.output
print(e.output)
else:
print(e.output)
sys.exit(ExitCode.input_file)
if exit_with_error:
sys.exit(ExitCode.input_file)
log.debug(out)
+3 -3
View File
@@ -126,13 +126,13 @@ def _page_has_text(pdf, page):
return False
def _pdf_get_pageinfo(infile, page: int):
def _pdf_get_pageinfo(infile, pageno: int):
pageinfo = {}
pageinfo['pageno'] = page
pageinfo['pageno'] = pageno
pageinfo['images'] = []
pdf = pypdf.PdfFileReader(infile)
page = pdf.pages[page - 1]
page = pdf.pages[pageno]
pageinfo['has_text'] = _page_has_text(pdf, page)
+6 -1
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
# © 2015 James R. Barlow: github.com/jbarlow83
from __future__ import print_function, unicode_literals
from setuptools import setup
from subprocess import Popen, STDOUT, check_output, CalledProcessError
from string import Template
@@ -9,6 +10,10 @@ import re
import sys
if sys.version_info < (3, 4):
print("Python 3.4 or newer is required")
sys.exit(1)
missing_program = '''
The program '{program}' could not be executed or was not found on your
system PATH.
@@ -179,7 +184,7 @@ tests_require = open('test_requirements.txt').read().splitlines()
setup(
name='ocrmypdf',
version='3.1', # also update: release notes, main.py
version='3.1.1', # also update: release notes, main.py
description='OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched',
url='https://github.com/jbarlow83/OCRmyPDF',
author='James R. Barlow',