Skip to content

Commit 68b27d5

Browse files
authored
Update pypdf in nemo-media-columns (#523)
1 parent c1823b6 commit 68b27d5

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

nemo-media-columns/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Depends: ${misc:Depends},
1414
python-nemo (>= 3.9.0),
1515
gir1.2-gexiv2-0.10,
1616
python3-mutagen,
17-
python3-pypdf2,
17+
python3-pypdf,
1818
python3-pil,
1919
python3-pymediainfo,
2020
gir1.2-nemo-3.0,

nemo-media-columns/nemo-media-columns.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# for reading image dimensions
3939
import PIL.Image
4040
# for reading pdf
41-
from PyPDF2 import PdfFileReader
41+
from pypdf import PdfReader
4242

4343
# Import the gettext function and alias it as _
4444
from gettext import gettext as _
@@ -362,12 +362,12 @@ def file_is_one_of_these(mimetype_list):
362362

363363
try:
364364
with open(filename, "rb") as f:
365-
pdf = PdfFileReader(f)
366-
try: info.title = pdf.getDocumentInfo().title
365+
pdf = PdfReader(f)
366+
try: info.title = pdf.metadata.title
367367
except: pass
368-
try: info.artist = pdf.getDocumentInfo().author
368+
try: info.artist = pdf.metadata.author
369369
except: pass
370-
try: info.pages = str(pdf.getNumPages())
370+
try: info.pages = str(len(pdf.pages))
371371
except: pass
372372
except:
373373
pdf_good = False

nemo-media-columns/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# 'python-nemo >=3.8',
2424
# 'gir1.2-gexiv2-0.10',
2525
# 'mutagen',
26-
# 'pypdf2',
26+
# 'pypdf',
2727
# 'pil',
2828
# 'pymediainfo'
2929
# 'stopit'],

0 commit comments

Comments
 (0)