fix image index in word backend

Signed-off-by: Manuel030 <manuelenrique.plank@gmail.com>
This commit is contained in:
Manuel030 2024-11-26 15:13:10 +01:00
parent d7072b4b56
commit 1b7a3756e0

View File

@ -503,8 +503,9 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend):
image_bytes = BytesIO(image_data)
# Open the BytesIO object with PIL to create an Image
pil_image = Image.open(image_bytes)
level = self.get_level()
doc.add_picture(
parent=self.parents[self.level],
parent=self.parents[level - 1],
image=ImageRef.from_pil(image=pil_image, dpi=72),
caption=None,
)