File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
dangerzone/isolation_provider Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -183,12 +183,15 @@ def _convert(
183
183
n_pages = read_int (p .stdout )
184
184
if n_pages == 0 or n_pages > errors .MAX_PAGES :
185
185
raise errors .MaxPagesException ()
186
- step = 100 / n_pages / 2
186
+ step = 100 / n_pages
187
187
188
188
safe_doc = fitz .Document ()
189
189
190
190
for page in range (1 , n_pages + 1 ):
191
- text = f"Converting page { page } /{ n_pages } to pixels"
191
+ searchable = "searchable " if ocr_lang else ""
192
+ text = (
193
+ f"Converting page { page } /{ n_pages } from pixels to { searchable } PDF"
194
+ )
192
195
percentage += step
193
196
self .print_progress (document , False , text , percentage )
194
197
@@ -205,15 +208,7 @@ def _convert(
205
208
num_pixels ,
206
209
)
207
210
208
- if ocr_lang :
209
- text = (
210
- f"Converting page { page } /{ n_pages } from pixels to"
211
- " searchable PDF"
212
- )
213
- else :
214
- text = f"Converting page { page } /{ n_pages } from pixels to PDF"
215
211
percentage += step
216
- self .print_progress (document , False , text , percentage )
217
212
218
213
page_pdf = self .pixels_to_pdf_page (
219
214
untrusted_pixels ,
You can’t perform that action at this time.
0 commit comments