File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff line change 3838# for reading image dimensions
3939import 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 _
4444from 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
Original file line number Diff line number Diff line change 2323 # 'python-nemo >=3.8',
2424 # 'gir1.2-gexiv2-0.10',
2525 # 'mutagen',
26- # 'pypdf2 ',
26+ # 'pypdf ',
2727 # 'pil',
2828 # 'pymediainfo'
2929 # 'stopit'],
You can’t perform that action at this time.
0 commit comments