Need to keep the rename step

This commit is contained in:
Micah Lee 2021-11-23 16:28:26 -08:00
parent 7c4f35e0f8
commit cbdb741f7b
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -111,6 +111,15 @@ def convert(input_filename, output_filename, ocr_lang, stdout_callback):
if ret != 0:
print("pixels-to-pdf failed")
else:
# Move the final file to the right place
if os.path.exists(output_filename):
os.remove(output_filename)
container_output_filename = os.path.join(
safe_dir, "safe-output-compressed.pdf"
)
os.rename(container_output_filename, output_filename)
# We did it
success = True