From 5f6e4d08ed8b0c0e6a3aa87dc5a43871eb9e82ff Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 May 2020 08:37:37 +0530 Subject: [PATCH] Fix #1879313 [Problem with image name containing capitalization when compressing](https://bugs.launchpad.net/calibre/+bug/1879313) --- src/calibre/ebooks/oeb/polish/images.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/oeb/polish/images.py b/src/calibre/ebooks/oeb/polish/images.py index c1165850cb..56cee5b8d3 100644 --- a/src/calibre/ebooks/oeb/polish/images.py +++ b/src/calibre/ebooks/oeb/polish/images.py @@ -81,11 +81,12 @@ def compress_images(container, report=None, names=None, jpeg_quality=None, progr seen = set() num_to_process = 0 for name in sorted(images): - path = os.path.normcase(os.path.abspath(container.get_file_path_for_processing(name))) - if path not in seen: + path = os.path.abspath(container.get_file_path_for_processing(name)) + path_key = os.path.normcase(path) + if path_key not in seen: num_to_process += 1 queue.put((name, path, container.mime_map[name])) - seen.add(path) + seen.add(path_key) def pc(name): keep_going = progress_callback(len(results), num_to_process, name)