7ef37540 by 周伟奇

Update pdf_to_img.py

1 parent 58addb24
...@@ -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):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!