From 8a4f0d80a3359bc3f2f5a0b543fd1405c6ccf4b9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 May 2010 10:47:11 -0600 Subject: [PATCH 1/2] Fix #5471 (Cannot import ePub book to 0.6.51) --- src/calibre/ebooks/metadata/epub.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/metadata/epub.py b/src/calibre/ebooks/metadata/epub.py index 5897f19929..1dab9cd91c 100644 --- a/src/calibre/ebooks/metadata/epub.py +++ b/src/calibre/ebooks/metadata/epub.py @@ -133,11 +133,11 @@ def get_cover(opf, opf_path, stream, reader=None): stream.seek(0) zf = ZipFile(stream) if raster_cover: - if reader is not None and \ - reader.encryption_meta.is_encrypted(raster_cover): - return base = posixpath.dirname(opf_path) cpath = posixpath.normpath(posixpath.join(base, raster_cover)) + if reader is not None and \ + reader.encryption_meta.is_encrypted(cpath): + return try: member = zf.getinfo(cpath) except: From 1301291729464966e8e6a5573b76ded9113b507c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 May 2010 11:27:15 -0600 Subject: [PATCH 2/2] HTML Input: Fix silly bug in case sensitivity detection --- src/calibre/ebooks/html/input.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index 326afc00c0..413db1cc0b 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -296,8 +296,8 @@ class HTMLInput(InputFormatPlugin): return self._is_case_sensitive if not path or not os.path.exists(path): return islinux or isfreebsd - self._is_case_sensitive = os.path.exists(path.lower()) \ - and os.path.exists(path.upper()) + self._is_case_sensitive = not (os.path.exists(path.lower()) \ + and os.path.exists(path.upper())) return self._is_case_sensitive def create_oebbook(self, htmlpath, basedir, opts, log, mi):