From 2c0257b93f1b9bcdd166cc6a1d9f165b00be12ed Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Thu, 31 May 2018 17:07:37 +0200 Subject: [PATCH] Mimetype of facsimile pages can vary --- imxml2epub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imxml2epub.py b/imxml2epub.py index 830d8ed..645e035 100755 --- a/imxml2epub.py +++ b/imxml2epub.py @@ -1263,7 +1263,9 @@ class FootnoteError(Exception): strImageFilepath = libeoaconvert.sanitizeImage(os.getcwd() + "/CONVERT/epub/OEBPS/images/" + strImageFileDir + strImageFileName, GM_PATH, TL_PATH) # Add copied file to contentopf - contentopf = addToContentopf(contentopf, "images/" + strImageFileDir + strImageFileName, strImageFileDir + strImageFileName, "jpg") + img_base_file_name, img_file_extension = os.path.splitext(strImageFileName) + + contentopf = addToContentopf(contentopf, "images/" + strImageFileDir + strImageFileName, strImageFileDir + strImageFileName, img_file_extension[1:]) # strSVGTemplate = """""" # xmlSVGFacsimile = etree.fromstring(strSVGTemplate)