Skip to content

Commit

Permalink
Don't show 50% duplicated progress info
Browse files Browse the repository at this point in the history
50% would show twice in the conversion progress due to an overlap in
conversion progress values. The doc_to_pixels would be from 0-50% and
the pixels_to_pdf from 50%-100%.

This commit makes the first part go from 0 to 49% instead.

Fixes #715
  • Loading branch information
deeplow committed Feb 15, 2024
1 parent f569695 commit 4e1ea52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dangerzone/isolation_provider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def doc_to_pixels(self, document: Document, tempdir: str) -> None:
n_pages = read_int(p.stdout)
if n_pages == 0 or n_pages > errors.MAX_PAGES:
raise errors.MaxPagesException()
percentage_per_page = 50.0 / n_pages
percentage_per_page = 49.0 / n_pages

for page in range(1, n_pages + 1):
text = f"Converting page {page}/{n_pages} to pixels"
Expand Down

0 comments on commit 4e1ea52

Please sign in to comment.