mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Container: ignore non-progress pdftoppm output
pdftoppm raises Syntax issues and Errors on a variety of documents. But it still produces usable results despite the failures. From the user's perspective it's best to have a document even if imperfect than having none at all. For this reason, we ignore non-relevant output.
This commit is contained in:
parent
dbd0450542
commit
541fe7f382
1 changed files with 4 additions and 1 deletions
|
@ -305,7 +305,10 @@ class DangerzoneConverter:
|
||||||
num_pages = int(num_pages_str)
|
num_pages = int(num_pages_str)
|
||||||
page = int(page_str)
|
page = int(page_str)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
raise RuntimeError("Conversion from PDF to PPM failed") from e
|
# Ignore all non-progress related output, since pdftoppm sends
|
||||||
|
# everything to stderr and thus, errors can't be distinguished
|
||||||
|
# easily. We rely instead on the exit code.
|
||||||
|
return
|
||||||
|
|
||||||
percentage_per_page = 45.0 / num_pages
|
percentage_per_page = 45.0 / num_pages
|
||||||
self.percentage += percentage_per_page
|
self.percentage += percentage_per_page
|
||||||
|
|
Loading…
Reference in a new issue