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

corrupt images in stub pdf #1

Open
g-raffy opened this issue Sep 8, 2018 · 2 comments
Open

corrupt images in stub pdf #1

g-raffy opened this issue Sep 8, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@g-raffy
Copy link
Owner

g-raffy commented Sep 8, 2018

sometimes, one page of the resulting stub pdf contains a corrupted image (the bottom part contains wring pixel values).

The input images are not corrupted though. The corruption happens during the pdflatex part. Double check that the input images are completely written at the moment they are used as input

@g-raffy g-raffy added the bug Something isn't working label Sep 8, 2018
@g-raffy
Copy link
Owner Author

g-raffy commented Sep 10, 2018

added a function that checks the integrity of a pdf file. This helped me to discover that the corruption seems to be caused by subprocess.check_call, which seems to not wait for the completion of the command before carrying on, as should be expected.

I replaced subprocess.check_call with subprocess.Popen + wait(), which seems to work better. For security, I added a call to detect malformed pdf in the case this fix doesn't prove to work 100%.

@g-raffy g-raffy closed this as completed Sep 10, 2018
@g-raffy
Copy link
Owner Author

g-raffy commented Sep 11, 2018

replacing subprocess.check_call with subprocess.Popen didn't fix this bug : I just had a corrupt pdf again

@g-raffy g-raffy reopened this Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant