Migrated pypdf2 to the now active developed pypdf

This commit is contained in:
Ozzie Isaacs 2023-01-22 11:31:47 +01:00
parent 791bc9621a
commit c21a870b8e
3 changed files with 15 additions and 8 deletions

View File

@ -36,11 +36,17 @@ except (ImportError, RuntimeError) as e:
log.debug('Cannot import Image, generating pdf covers for pdf uploads will not work: %s', e)
use_generic_pdf_cover = True
try:
from PyPDF import PdfReader
use_pdf_meta = True
except ImportError as ex:
log.debug('PyPDF is recommended for best performance in metadata extracting from pdf files: %s', ex)
try:
from PyPDF2 import PdfReader
use_pdf_meta = True
except ImportError as ex:
log.debug('PyPDF2 is recommended for best performance in metadata extracting from pdf files: %s', ex)
log.debug('PyPDF is recommended for best performance in metadata extracting from pdf files: %s', ex)
log.debug('PyPdf2 is also possible for metadata extracting from pdf files, but not recommended anymore')
try:
from PyPDF3 import PdfFileReader as PdfReader
use_pdf_meta = True

View File

@ -7,7 +7,7 @@ Flask-Principal>=0.3.2,<0.5.1
backports_abc>=0.4
Flask>=1.0.2,<2.2.0
iso-639>=0.4.5,<0.5.0
PyPDF2>=1.28,<3.1.0
PyPDF>=3.0.0,<3.3.0
pytz>=2016.10
requests>=2.11.1,<2.28.0
SQLAlchemy>=1.3.0,<1.5.0

View File

@ -23,6 +23,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Operating System :: OS Independent
keywords =
calibre
@ -46,7 +47,7 @@ install_requires =
backports_abc>=0.4
Flask>=1.0.2,<2.2.0
iso-639>=0.4.5,<0.5.0
PyPDF2>=1.28,<3.1.0
PyPDF>=3.0.0,<3.3.0
pytz>=2016.10
requests>=2.11.1,<2.28.0
SQLAlchemy>=1.3.0,<1.5.0