Alex Strick van Linschoten commited on
Commit
77b425a
1 Parent(s): 94a07a2

fix listdir arg

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -81,18 +81,13 @@ def predict(pdf, confidence, generate_file):
81
  imagelist = sorted(
82
  [
83
  i
84
- for i in os.listdir(tmp_dir, filename_without_extension)
 
 
85
  if i.endswith("png")
86
  ]
87
  )
88
  for image in imagelist:
89
- # with PILImage.open(os.path.join(tmp_dir, image)) as img:
90
- # size = img.size
91
- # if size[0] > size[1]:
92
- # pdf.add_page("L")
93
- # else:
94
- # pdf.add_page("P")
95
- # pdf.image(os.path.join(tmp_dir, image))
96
  with PILImage.open(
97
  os.path.join(tmp_dir, filename_without_extension, image)
98
  ) as img:
81
  imagelist = sorted(
82
  [
83
  i
84
+ for i in os.listdir(
85
+ os.path.join(tmp_dir, filename_without_extension)
86
+ )
87
  if i.endswith("png")
88
  ]
89
  )
90
  for image in imagelist:
 
 
 
 
 
 
 
91
  with PILImage.open(
92
  os.path.join(tmp_dir, filename_without_extension, image)
93
  ) as img: