From 2ad7f3a52eb41bb8478a3a9ce2f21180c242bcb8 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 11 Jul 2021 11:27:57 +0200 Subject: [PATCH] cbz2ebook: Use mt map for opening image and zip This apparently solves some weird issues with reading the zip file like zlib.error: Error -3 while decompressing data: invalid block type zlib.error: Error -3 while decompressing data: invalid distance too far back Though it reduced the amount of times this happened, some files still persistently refuse to be read by zipfile in parallel. In those cases, using `-s` to force single-threading should be sufficient. --- cbz2ebook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbz2ebook.py b/cbz2ebook.py index e269428..554d3ec 100755 --- a/cbz2ebook.py +++ b/cbz2ebook.py @@ -70,7 +70,7 @@ else: for idx, im in enumerate( tqdm( - mapper(process_image, map(Image.open, map(srczip.open, srcfiles)),), + mapper(process_image, mapper(Image.open, mapper(srczip.open, srcfiles)),), total=len(srcfiles), ) ):