Spaces:
Running
Running
fix: pdf2Image zoom -> 10
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def pdf_to_images(pdf_path):
|
|
28 |
for page_num in range(len(pdf_document)):
|
29 |
page = pdf_document.load_page(page_num)
|
30 |
# 进一步增加分辨率和缩放比例
|
31 |
-
zoom =
|
32 |
mat = fitz.Matrix(zoom, zoom)
|
33 |
pix = page.get_pixmap(matrix=mat, alpha=False)
|
34 |
img = Image.frombytes("RGB", [pix.width, pix.height], pix.samples)
|
|
|
28 |
for page_num in range(len(pdf_document)):
|
29 |
page = pdf_document.load_page(page_num)
|
30 |
# 进一步增加分辨率和缩放比例
|
31 |
+
zoom = 10 # 增加缩放比例到4
|
32 |
mat = fitz.Matrix(zoom, zoom)
|
33 |
pix = page.get_pixmap(matrix=mat, alpha=False)
|
34 |
img = Image.frombytes("RGB", [pix.width, pix.height], pix.samples)
|