From 8fac38cf4d92a3f961dc776efdcc1af600f09b36 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 30 Jan 2019 15:24:48 +0530 Subject: [PATCH] Fix font mime-types not being auto-corrected when upgrading EPUBs from 2 to 3 --- src/calibre/ebooks/oeb/polish/upgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/upgrade.py b/src/calibre/ebooks/oeb/polish/upgrade.py index 5dfe37a7ac..ff6ff7d972 100644 --- a/src/calibre/ebooks/oeb/polish/upgrade.py +++ b/src/calibre/ebooks/oeb/polish/upgrade.py @@ -25,7 +25,7 @@ def add_properties(item, *props): def fix_font_mime_types(container): for item in container.opf_xpath('//opf:manifest/opf:item[@href and @media-type]'): mt = item.get('media-type') or '' - if mt.lower() not in OEB_FONTS: + if mt.lower() in OEB_FONTS: name = container.href_to_name(item.get('href'), container.opf_name) item.set('media-type', container.guess_type(name))