Update pdf_to_img.py
Showing
1 changed file
with
6 additions
and
1 deletions
... | @@ -81,7 +81,12 @@ class PDFHandler: | ... | @@ -81,7 +81,12 @@ class PDFHandler: |
81 | tpix = fitz.Pixmap(fitz.csRGB, pix) | 81 | tpix = fitz.Pixmap(fitz.csRGB, pix) |
82 | return tpix | 82 | return tpix |
83 | else: | 83 | else: |
84 | return doc.extractImage(xref) | 84 | res = doc.extractImage(xref) |
85 | if res is None: | ||
86 | return fitz.Pixmap(doc, xref) | ||
87 | else: | ||
88 | return res | ||
89 | # return doc.extractImage(xref) | ||
85 | 90 | ||
86 | @staticmethod | 91 | @staticmethod |
87 | def get_img_data(pix): | 92 | def get_img_data(pix): | ... | ... |
-
Please register or sign in to post a comment