fix pdf_to_img
Showing
1 changed file
with
5 additions
and
1 deletions
| ... | @@ -205,7 +205,11 @@ class PDFHandler: | ... | @@ -205,7 +205,11 @@ class PDFHandler: |
| 205 | tpix = fitz.Pixmap(fitz.csRGB, pix) | 205 | tpix = fitz.Pixmap(fitz.csRGB, pix) |
| 206 | return tpix | 206 | return tpix |
| 207 | else: | 207 | else: |
| 208 | return doc.extractImage(xref) | 208 | res = doc.extractImage(xref) |
| 209 | if res is None: | ||
| 210 | return fitz.Pixmap(doc, xref) | ||
| 211 | else: | ||
| 212 | return res | ||
| 209 | 213 | ||
| 210 | @staticmethod | 214 | @staticmethod |
| 211 | def get_img_data(pix): | 215 | def get_img_data(pix): | ... | ... |
-
Please register or sign in to post a comment