Fix font mime-types not being auto-corrected when upgrading EPUBs from 2 to 3

This commit is contained in:
Kovid Goyal 2019-01-30 15:24:48 +05:30
parent b086766064
commit 8fac38cf4d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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))