DOCX Output: Fix multiple SVG images in the input document causing all the SVG images in the output to be just one of the input images. Fixes #2024433 [Private bug](https://bugs.launchpad.net/calibre/+bug/2024433)

Stupid python loop variable binding rules.
This commit is contained in:
Kovid Goyal 2023-06-20 14:27:23 +05:30
parent 206383eb4b
commit b3a19a0afc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -203,8 +203,12 @@ class ImagesManager:
def serialize(self, images_map):
for img in self.images.values():
images_map['word/' + img.fname] = partial(self.get_data, img.item)
def get_svg_data(img):
return img.item.data_as_bytes_or_none
for img in self.svg_images.values():
images_map['word/' + img.fname] = lambda: img.item.data_as_bytes_or_none
images_map['word/' + img.fname] = partial(get_svg_data, img)
def get_data(self, item):
try: