Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compressing single-page, small-sized, high-resolution PDF #146

Closed
sycam0r-e opened this issue Feb 1, 2022 · 4 comments
Closed

Error compressing single-page, small-sized, high-resolution PDF #146

sycam0r-e opened this issue Feb 1, 2022 · 4 comments
Labels
bug Something isn't working timeout Dangerzone Times Out

Comments

@sycam0r-e
Copy link

Host OS: macOS 10.14.6
Docker Desktop: Version 4.4.2 (73305)
Danger Zone: Version 0.3.1

Problem:
I try to convert a one-sided PDF that has a size of 922KB and a resolution of 6048 × 3024. It contains a lot of pictures and graphs. The whole process works until Dangerzone "Compresses PDF" and throws the following error message: "Error compressing PDF, ps2pdf timed out after 3 seconds". This happens independently of whether OCR or opening the safe PDF after converting are selected.

Expected behavior:
Dangerzone should successfully compress the PDF.

This issues is similar to #70. Maybe the fix could be, too, by increasing the timeout or calculate it based on the PDF's resolution?

Let me know if you need further information.

@sycam0r-e sycam0r-e changed the title Error compressing small-sized high-resolution PDF Error compressing single-page, small-sized, and high-resolution PDF Feb 1, 2022
@sycam0r-e sycam0r-e changed the title Error compressing single-page, small-sized, and high-resolution PDF Error compressing single-page, small-sized, high-resolution PDF Feb 1, 2022
@gmarmstrong
Copy link
Contributor

gmarmstrong commented Jun 5, 2022

The file compression step has a different timeout value (3 seconds per page) than our default of 60 seconds (which itself has caused problems in #149):

compress_timeout = num_pages * 3

Relaxing that would certainly help, and file size would be a good start. Ideally, we would have no timeout at all as long as we can see that the process is making progress. From that, we could even calculate an ETA on the expected duration. If ps2pdf (which we use for PDF compression) doesn't have that capability, then it also being a culprit in #158 would make me want to reconsider using it as a compression tool.

@deeplow deeplow added the bug Something isn't working label Aug 17, 2022
apyrgio added a commit that referenced this issue Nov 23, 2022
Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
@apyrgio
Copy link
Contributor

apyrgio commented Nov 23, 2022

We will bump the timeout in the 0.4.0 release (not yet released). Let's keep this issue open for a little while, so that we can see if an increased timeout helps. Please comment here once you have 0.4.0 installed and this bug still affects you. Else, we can close this issue.

Note that increasing the timeout won't solve the underlying issue, but it will make it very rare, which is a good first step.

apyrgio added a commit that referenced this issue Nov 23, 2022
Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
@sycam0r-e
Copy link
Author

Thanks, this sounds reasonable.

@deeplow deeplow added the timeout Dangerzone Times Out label Jan 23, 2023
@apyrgio
Copy link
Contributor

apyrgio commented Oct 3, 2023

Timeout issues have been resolved in recent Dangerzone releases. Closing this issue, but feel free to re-open it if you still have a problem.

@apyrgio apyrgio closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working timeout Dangerzone Times Out
Projects
None yet
Development

No branches or pull requests

4 participants