X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/db91f942ce46e3af1420f3469a83257ef5aca4c2..12727dd036c3f54c487aaa70b21bf4988135bb7d:/src/librarian/elements/figures/ilustr.py?ds=sidebyside diff --git a/src/librarian/elements/figures/ilustr.py b/src/librarian/elements/figures/ilustr.py index ab7c2b7..af936fb 100644 --- a/src/librarian/elements/figures/ilustr.py +++ b/src/librarian/elements/figures/ilustr.py @@ -27,10 +27,9 @@ class Ilustr(WLElement): else: th = img.resize((width, round(width * img.size[1] / img.size[0]))) - imgfile.close() buffer = six.BytesIO() th.save(buffer, format=th_format) - ## TODO: Counter + imgfile.close() file_name = 'image%d.%s' % ( builder.assign_image_number(), ext @@ -44,8 +43,8 @@ class Ilustr(WLElement): return { 'src': file_name, - 'alt': self.attrib['alt'], - 'title': self.attrib['alt'], + 'alt': self.attrib.get('alt', ''), + 'title': self.attrib.get('alt', ''), } get_epub_attr = get_html_attr