From c60684467799d2f0e2ad0b4b50086220ac5bc1fe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 5 Jan 2017 10:14:19 +0530 Subject: [PATCH] Edit Book: Fix Check Book reporting a spurious mime/type mismatch error after replacing a file with a file having a different mime type. Fixes #1653977 [Editor:Problem with Check Book after using Replace image with file](https://bugs.launchpad.net/calibre/+bug/1653977) --- src/calibre/ebooks/oeb/polish/replace.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/ebooks/oeb/polish/replace.py b/src/calibre/ebooks/oeb/polish/replace.py index 8a6f2deb96..d3b289a19d 100644 --- a/src/calibre/ebooks/oeb/polish/replace.py +++ b/src/calibre/ebooks/oeb/polish/replace.py @@ -219,6 +219,7 @@ def replace_file(container, name, path, basename, force_mt=None): nname = b + ('_%d.%s' % (count, e)) rename_files(container, {name:nname}) mt = force_mt or container.guess_type(nname) + container.mime_map[nname] = mt for itemid, q in container.manifest_id_map.iteritems(): if q == nname: for item in container.opf_xpath('//opf:manifest/opf:item[@href and @id="%s"]' % itemid):