We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16b4630 commit 3c5e288Copy full SHA for 3c5e288
src/axiomatic/client.py
@@ -68,9 +68,10 @@ def navigate_image(change):
68
def save_parsed_pdf(self, response: ParseResponse, path: str):
69
"""Save a parsed PDF response to a file."""
70
os.makedirs(path, exist_ok=True)
71
- for img_name, img in response.images.items():
72
- with open(os.path.join(path, f"{img_name}.png"), "wb") as f:
73
- f.write(base64.b64decode(img))
+ if response.images:
+ for img_name, img in response.images.items():
+ with open(os.path.join(path, f"{img_name}.png"), "wb") as f:
74
+ f.write(base64.b64decode(img))
75
76
with open(os.path.join(path, "text.md"), "w") as f:
77
f.write(response.markdown)
0 commit comments