Skip to content

Commit 3c5e288

Browse files
committed
fix poetry
1 parent 16b4630 commit 3c5e288

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/axiomatic/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ def navigate_image(change):
6868
def save_parsed_pdf(self, response: ParseResponse, path: str):
6969
"""Save a parsed PDF response to a file."""
7070
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))
71+
if response.images:
72+
for img_name, img in response.images.items():
73+
with open(os.path.join(path, f"{img_name}.png"), "wb") as f:
74+
f.write(base64.b64decode(img))
7475

7576
with open(os.path.join(path, "text.md"), "w") as f:
7677
f.write(response.markdown)

0 commit comments

Comments
 (0)