From: Christian Heller Date: Sun, 24 Sep 2023 00:08:33 +0000 (+0200) Subject: In Bookmaker, fix page numbering / selection bug. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%22https:/validator.w3.org/ledger?a=commitdiff_plain;h=e0da0a9197adced52d4fd936fa6d309040de8feb;p=misc In Bookmaker, fix page numbering / selection bug. --- diff --git a/bookmaker.py b/bookmaker.py index 3a36b96..b9daa0b 100755 --- a/bookmaker.py +++ b/bookmaker.py @@ -36,6 +36,7 @@ def parse_page_range(range_string, pages): return start_page, end_page pages_to_add = [] opened_files = [] +new_page_num = 0 for i, input_file in enumerate(args.input_file): file = open(input_file, 'rb') opened_files += [file] @@ -44,12 +45,11 @@ for i, input_file in enumerate(args.input_file): if args.page_range and len(args.page_range) > i: range_string = args.page_range[i] start_page, end_page = parse_page_range(range_string, reader.pages) - new_page_num = 0 for old_page_num in range(start_page, end_page): new_page_num += 1 - page = reader.pages[new_page_num] + page = reader.pages[old_page_num] pages_to_add += [page] - print("-i, -p: read in %s page number %d as new page %d" % (input_file, new_page_num+1, new_page_num)) + print("-i, -p: read in %s page number %d as new page %d" % (input_file, old_page_num+1, new_page_num)) # rotate page canvas if args.rotate: