diff options
| -rw-r--r-- | NEWS | 5 | ||||
| -rw-r--r-- | mammoth/docx/document_xml.py | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,8 @@ +# 0.3.13 + +* Always use forward slashes in ZIP paths. This should fix image handling on + Windows. + # 0.3.12 * Make style names case-insensitive in style mappings. This should make style diff --git a/mammoth/docx/document_xml.py b/mammoth/docx/document_xml.py index 8bfdd6f..9477ab5 100644 --- a/mammoth/docx/document_xml.py +++ b/mammoth/docx/document_xml.py @@ -1,4 +1,3 @@ -import os import contextlib from .. import documents @@ -220,7 +219,7 @@ def _create_reader(numbering, content_types, relationships, styles, note_element def _read_blip(element, alt_text): relationship_id = element.attributes["r:embed"] - image_path = os.path.join("word", relationships[relationship_id].target) + image_path = "word/" + relationships[relationship_id].target.lstrip("/") content_type = content_types.find_content_type(image_path) def open_image(): |
