not-lain commited on
Commit
72423ad
·
1 Parent(s): 423180d
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -5,6 +5,8 @@ import fitz
5
  from typing import List
6
  from PIL import Image
7
  from loadimg import load_img
 
 
8
 
9
  converter = Converter()
10
 
@@ -42,7 +44,7 @@ def convert_file_to_img(image_file:str) -> List[Image.Image] :
42
  doc = fitz.open(output_path)
43
  for page in doc:
44
  page_bytes = page.get_pixmap().tobytes("png")
45
- img_list.append(load_img(page_bytes).convert("RGB"))
46
  doc.close()
47
  return img_list
48
 
 
5
  from typing import List
6
  from PIL import Image
7
  from loadimg import load_img
8
+ import io
9
+
10
 
11
  converter = Converter()
12
 
 
44
  doc = fitz.open(output_path)
45
  for page in doc:
46
  page_bytes = page.get_pixmap().tobytes("png")
47
+ img_list.append(load_img(Image.open(io.BytesIO(page_bytes))).convert("RGB"))
48
  doc.close()
49
  return img_list
50