Skip to content

Commit

Permalink
Fixed numbering bug
Browse files Browse the repository at this point in the history
Page 301/292 didn't seem right...
  • Loading branch information
nimaid committed Jul 7, 2020
1 parent 6f8ea11 commit 5cb616d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bookdir2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,15 @@ def get_valid_filename(s):
Path(os.path.dirname(p)).mkdir(parents=True, exist_ok=True)

# Process image files
curr_page = 0 # Will go to 1 before first print
for x, p in enumerate(page_list):
final_p = new_page_list[x]
if os.path.isfile(p):
# It's an image file
curr_page += 1
with Image.open(p) as page_im:
if purify:
print("[PURIFY] ({}/{}): {}".format(x+1, num_pages, p))
print("[PURIFY] ({}/{}): {}".format(curr_page, num_pages, p))
# Make greyscale
gray = page_im.convert('L')

Expand Down

0 comments on commit 5cb616d

Please sign in to comment.