Open g-raffy opened 6 years ago
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%.
replacing subprocess.check_call with subprocess.Popen didn't fix this bug : I just had a corrupt pdf again
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