mirror of
https://github.com/ciromattia/kcc
synced 2026-09-01 16:37:06 +00:00
skip blanks on image based pdfs (#1228)
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user