1
0
mirror of https://github.com/ciromattia/kcc synced 2026-02-19 18:48:57 +00:00

skip blanks on image based pdfs (#1228)

This commit is contained in:
Alex Xu
2026-01-26 09:56:44 -08:00
committed by GitHub
parent fbd5980b9b
commit 38acc3bf05

View File

@@ -801,9 +801,7 @@ def extract_page(vector):
if len(image_list) > 1:
raise UserWarning("mupdf_pdf_extract_page_image() function can be used only with single image pages.")
if not image_list:
width, height = int(page.rect.width), int(page.rect.height)
blank_page = Image.new("RGB", (width, height), "white")
blank_page.save(output_path)
continue
else:
xref = image_list[0][0]
d = doc.extract_image(xref)