skip blanks on image based pdfs (#1228)

This commit is contained in:
Alex Xu authored and GitHub committed 2026-01-26 09:56:44 -08:00
1 parent fbd5980b9b
commit 38acc3bf05
1 file changed
+1 -3
+1 -3
View File
@@ -801,9 +801,7 @@ def extract_page(vector):
if len(image_list) > 1: if len(image_list) > 1:
raise UserWarning("mupdf_pdf_extract_page_image() function can be used only with single image pages.") raise UserWarning("mupdf_pdf_extract_page_image() function can be used only with single image pages.")
if not image_list: if not image_list:
width, height = int(page.rect.width), int(page.rect.height) continue
blank_page = Image.new("RGB", (width, height), "white")
blank_page.save(output_path)
else: else:
xref = image_list[0][0] xref = image_list[0][0]
d = doc.extract_image(xref) d = doc.extract_image(xref)